Skip to content

Commit eff66e9

Browse files
author
Ed Munoz
committed
Various fixes for unit tests
1 parent 761e80e commit eff66e9

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

src/ServiceManagement/Network/Commands.Network.Test/Commands.Network.Test.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@
9595
<SpecificVersion>False</SpecificVersion>
9696
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
9797
</Reference>
98+
<Reference Include="Microsoft.WindowsAzure.Management.Compute">
99+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.3.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
100+
</Reference>
98101
<Reference Include="Microsoft.WindowsAzure.Management.Network">
99102
<SpecificVersion>False</SpecificVersion>
100103
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Network.7.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll</HintPath>
@@ -174,6 +177,14 @@
174177
<Project>{46c06ed8-43d9-41fd-b73b-41547d9c04e1}</Project>
175178
<Name>Commands.Network</Name>
176179
</ProjectReference>
180+
<ProjectReference Include="..\..\..\Common\Commands.Common.Test\Commands.Common.Test.csproj">
181+
<Project>{3b48a77b-5956-4a62-9081-92ba04b02b27}</Project>
182+
<Name>Commands.Common.Test</Name>
183+
</ProjectReference>
184+
<ProjectReference Include="..\..\Compute\Commands.ServiceManagement\Commands.ServiceManagement.csproj">
185+
<Project>{E1CA72BA-8374-45F6-904D-FD34ECDF5B6F}</Project>
186+
<Name>Commands.ServiceManagement</Name>
187+
</ProjectReference>
177188
</ItemGroup>
178189
<ItemGroup>
179190
<Folder Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NetworkTests\" />

src/ServiceManagement/Network/Commands.Network.Test/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.12.111071459" targetFramework="net45" />
1717
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1818
<package id="Microsoft.WindowsAzure.Management" version="4.0.1" targetFramework="net45" />
19+
<package id="Microsoft.WindowsAzure.Management.Compute" version="9.3.0" targetFramework="net45" />
1920
<package id="Microsoft.WindowsAzure.Management.Network" version="7.0.0" targetFramework="net45" />
2021
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
2122
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />

src/ServiceManagement/Network/Commands.Network/Commands.Network.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
</Reference>
8383
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8484
<SpecificVersion>False</SpecificVersion>
85-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.1\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
85+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.3.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
8686
</Reference>
8787
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=7.0.0.0, Culture=neutral, processorArchitecture=MSIL">
8888
<SpecificVersion>False</SpecificVersion>

src/ServiceManagement/Network/Commands.Network/NetworkClient.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ namespace Microsoft.Azure.Commands.Network
3838

3939
public class NetworkClient
4040
{
41-
private readonly NetworkManagementClient client;
42-
private readonly ComputeManagementClient computeClient;
43-
private readonly ManagementClient managementClient;
41+
private readonly INetworkManagementClient client;
42+
private readonly IComputeManagementClient computeClient;
43+
private readonly IManagementClient managementClient;
4444
private readonly ICommandRuntime commandRuntime;
4545

4646
public NetworkClient(AzureProfile profile, AzureSubscription subscription, ICommandRuntime commandRuntime)
@@ -50,7 +50,7 @@ public NetworkClient(AzureProfile profile, AzureSubscription subscription, IComm
5050
commandRuntime)
5151
{
5252
}
53-
public NetworkClient(NetworkManagementClient client, ComputeManagementClient computeClient, ManagementClient managementClient, ICommandRuntime commandRuntime)
53+
public NetworkClient(INetworkManagementClient client, IComputeManagementClient computeClient, IManagementClient managementClient, ICommandRuntime commandRuntime)
5454
{
5555
this.client = client;
5656
this.computeClient = computeClient;
@@ -819,7 +819,7 @@ public void RemoveNetworkSecurityRule(string securityGroupName, string securityR
819819
client.NetworkSecurityGroups.DeleteRule(securityGroupName, securityRuleName);
820820
}
821821

822-
public NetworkSecurityGroupGetForSubnetResponse GetNetworkSecurityGroupForSubnet(string virtualNetworkName, string subnetName)
822+
public NetworkSecurityGroupGetAssociationResponse GetNetworkSecurityGroupForSubnet(string virtualNetworkName, string subnetName)
823823
{
824824
return client.NetworkSecurityGroups.GetForSubnet(virtualNetworkName, subnetName);
825825
}
@@ -831,7 +831,7 @@ public void RemoveNetworkSecurityGroupFromSubnet(string networkSecurityGroupName
831831

832832
public void SetNetworkSecurityGroupForSubnet(string networkSecurityGroupName, string subnetName, string virtualNetworkName)
833833
{
834-
var parameters = new NetworkSecurityGroupAddToSubnetParameters()
834+
var parameters = new NetworkSecurityGroupAddAssociationParameters()
835835
{
836836
Name = networkSecurityGroupName
837837
};

src/ServiceManagement/Network/Commands.Network/NetworkCmdletBase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected AzureSubscription CurrentSubscription
3232
get { return Profile.Context.Subscription; }
3333
}
3434

35-
protected NetworkClient Client
35+
public NetworkClient Client
3636
{
3737
get
3838
{
@@ -42,6 +42,8 @@ protected NetworkClient Client
4242
}
4343
return client;
4444
}
45+
46+
set { this.client = value; }
4547
}
4648
}
4749
}

0 commit comments

Comments
 (0)