forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a063df
commit 7b3275b
Showing
9 changed files
with
112 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
experiments/Azure.Experiments/Azure.Experiments/DependencyLocation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Azure.Experiments | ||
{ | ||
public sealed class DependencyLocation | ||
{ | ||
public string Location { get; } | ||
|
||
public int Priority { get; } | ||
|
||
public DependencyLocation(string location, int priority) | ||
{ | ||
Location = location; | ||
Priority = priority; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using Microsoft.Rest; | ||
using Xunit; | ||
|
||
namespace Azure.Experiments.Tests | ||
{ | ||
public class UnitTests | ||
{ | ||
private static Context C { get; } | ||
= new Context(new TokenCredentials("a"), string.Empty); | ||
|
||
//[Fact] | ||
public void ResourceGroupObjectTest() | ||
{ | ||
var rg = new ResourceGroupObject(C, "My"); | ||
Assert.Equal(0, rg.Priority); | ||
} | ||
|
||
//[Fact] | ||
public void VirtualNetworkObjectTest() | ||
{ | ||
var rg = new ResourceGroupObject(C, "My1"); | ||
var vn = new VirtualNetworkObject(C.CreateNetwork(), "My1", rg, "192.168.0.0/16"); | ||
Assert.Equal(1, vn.Priority); | ||
} | ||
|
||
//[Fact] | ||
public void PublicIpAddressObjectTest() | ||
{ | ||
var rg = new ResourceGroupObject(C, "MyPIA"); | ||
var pia = new PublicIpAddressObject(C.CreateNetwork(), "MyPIA", rg); | ||
Assert.Equal(1, pia.Priority); | ||
} | ||
|
||
//[Fact] | ||
public void NetworkSecurityGroupTest() | ||
{ | ||
var c = Credentials.Get(); | ||
var rg = new ResourceGroupObject(c, "MyNSG"); | ||
var nsg = new NetworkSecurityGroupObject(c.CreateNetwork(), "MyNSG", rg); | ||
Assert.Equal(1, nsg.Priority); | ||
} | ||
|
||
//[Fact] | ||
public void SubnetObjectTest() | ||
{ | ||
var rg = new ResourceGroupObject(C, "MySubnet"); | ||
var vn = new VirtualNetworkObject(C.CreateNetwork(), "MySubnet", rg, "192.168.0.0/16"); | ||
var subnet = new SubnetObject("MySubnet", vn, "192.168.1.0/24"); | ||
Assert.Equal(2, subnet.Priority); | ||
} | ||
|
||
//[Fact] | ||
public void NetworkInterfaceObjectTest() | ||
{ | ||
var network = C.CreateNetwork(); | ||
var rg = new ResourceGroupObject(C, "MyNI"); | ||
var vn = new VirtualNetworkObject(network, "MyNI", rg, "192.168.0.0/16"); | ||
var subnet = new SubnetObject("MyNI", vn, "192.168.1.0/24"); | ||
var pia = new PublicIpAddressObject(network, "MyNI", rg); | ||
var nsg = new NetworkSecurityGroupObject(network, "MyNI", rg); | ||
var ni = new NetworkInterfaceObject(network, "MyNI", rg, subnet, pia, nsg); | ||
Assert.Equal(3, ni.Priority); | ||
} | ||
|
||
//[Fact] | ||
public void VmObjectTest() | ||
{ | ||
var network = C.CreateNetwork(); | ||
var rg = new ResourceGroupObject(C, "MyVM"); | ||
var vn = new VirtualNetworkObject(network, "MyVM", rg, "192.168.0.0/16"); | ||
var subnet = new SubnetObject("MyVM", vn, "192.168.1.0/24"); | ||
var pia = new PublicIpAddressObject(network, "MyVM", rg); | ||
var nsg = new NetworkSecurityGroupObject(network, "MyVM", rg); | ||
var ni = new NetworkInterfaceObject(network, "MyVM", rg, subnet, pia, nsg); | ||
var vm = new VmObject(C, "MyVM", rg, ni, "MyVMUser", "@3as54dDd"); | ||
Assert.Equal(4, vm.Priority); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters