Skip to content

Commit 494e0e6

Browse files
author
Samuel Anudeep
committed
Merge pull request #50 from MabOneSdk/anudeeb
Get-Container & PS Tests
2 parents b9cffa9 + 7e1e102 commit 494e0e6

File tree

5 files changed

+32
-21
lines changed

5 files changed

+32
-21
lines changed

src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,24 @@
161161
<None Include="ScenarioTests\AzureBackupItemTestCases.ps1">
162162
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
163163
</None>
164-
<None Include="ScenarioTests\AzureBackupPolicyTests.ps1" />
165-
<None Include="ScenarioTests\AzureBackupContainerTests.ps1" />
166-
<None Include="ScenarioTests\AzureBackupJobTests.ps1" />
167-
<None Include="ScenarioTests\AzureBackupVaultTests.ps1" />
168-
<None Include="ScenarioTests\BackupItemTests.ps1" />
169-
<None Include="ScenarioTests\RecoveryPointTests.ps1" />
164+
<None Include="ScenarioTests\AzureBackupPolicyTests.ps1">
165+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
166+
</None>
167+
<None Include="ScenarioTests\AzureBackupContainerTests.ps1">
168+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
169+
</None>
170+
<None Include="ScenarioTests\AzureBackupJobTests.ps1">
171+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
172+
</None>
173+
<None Include="ScenarioTests\AzureBackupVaultTests.ps1">
174+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
175+
</None>
176+
<None Include="ScenarioTests\BackupItemTests.ps1">
177+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
178+
</None>
179+
<None Include="ScenarioTests\RecoveryPointTests.ps1">
180+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
181+
</None>
170182
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests\GetAzureBackupContainerTests.json" />
171183
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests\RegisterAzureBackupContainerTest.json" />
172184
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests\UnregisterAzureBackupContainerTest.json" />

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/GetAzureBackupContainer.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using BCI = Microsoft.BackupManagementService.CommonInterface;
16-
using BMI = Microsoft.BackupManagementService.ManagementInterface;
15+
using Microsoft.Azure.Commands.AzureBackup.Library;
1716
using Microsoft.Azure.Management.BackupServices.Models;
1817
using System;
1918
using System.Collections.Generic;
@@ -94,12 +93,12 @@ public override void ExecuteCmdlet()
9493

9594
private string ConstructQueryFilterString()
9695
{
97-
BMI.ContainerQueryObject containerQueryObject = new BMI.ContainerQueryObject();
96+
ContainerQueryObject containerQueryObject = new ContainerQueryObject();
9897

9998
switch (Type)
10099
{
101100
case AzureBackupContainerTypeInput.AzureVirtualMachine:
102-
containerQueryObject.Type = BCI.ContainerType.IaasVMContainer.ToString();
101+
containerQueryObject.Type = ContainerType.IaasVMContainer.ToString();
103102
break;
104103
default:
105104
break;
@@ -108,10 +107,10 @@ private string ConstructQueryFilterString()
108107
switch (Status)
109108
{
110109
case AzureBackupContainerStatusInput.Registered:
111-
containerQueryObject.Status = BCI.RegistrationStatus.Registered.ToString();
110+
containerQueryObject.Status = RegistrationStatus.Registered.ToString();
112111
break;
113112
case AzureBackupContainerStatusInput.Registering:
114-
containerQueryObject.Status = BCI.RegistrationStatus.Registering.ToString();
113+
containerQueryObject.Status = RegistrationStatus.Registering.ToString();
115114
break;
116115
default:
117116
break;
@@ -122,7 +121,7 @@ private string ConstructQueryFilterString()
122121
containerQueryObject.FriendlyName = ContainerResourceName;
123122
}
124123

125-
return BMI.BackupManagementAPIHelper.GetQueryString(containerQueryObject.GetNameValueCollection());
124+
return BackupManagementAPIHelper.GetQueryString(containerQueryObject.GetNameValueCollection());
126125
}
127126
}
128127
}

src/ResourceManager/AzureBackup/Commands.AzureBackup/Commands.AzureBackup.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
<Reference Include="Hyak.Common">
5656
<HintPath>..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
5757
</Reference>
58-
<Reference Include="Microsoft.Azure.Common">
58+
<Reference Include="Microsoft.Azure.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
59+
<SpecificVersion>False</SpecificVersion>
5960
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
6061
</Reference>
6162
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -86,9 +87,13 @@
8687
<Reference Include="Microsoft.WindowsAzure.Management">
8788
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
8889
</Reference>
90+
<Reference Include="Microsoft.WindowsAzure.Management.BackupServicesManagment, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
91+
<SpecificVersion>False</SpecificVersion>
92+
<HintPath>..\..\..\..\..\azure-sdk-for-net\src\ResourceManagement\AzureBackup\BackupServicesManagment\bin\Net45-Debug\Microsoft.WindowsAzure.Management.BackupServicesManagment.dll</HintPath>
93+
</Reference>
8994
<Reference Include="Microsoft.WindowsAzure.Management.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9095
<SpecificVersion>False</SpecificVersion>
91-
<HintPath>Cmdlets\VaultCredentials\Microsoft.WindowsAzure.Management.Common.dll</HintPath>
96+
<HintPath>Resources\Microsoft.WindowsAzure.Management.Common.dll</HintPath>
9297
</Reference>
9398
<Reference Include="Microsoft.WindowsAzure.Management.Scheduler">
9499
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll</HintPath>
@@ -154,6 +159,7 @@
154159
<Compile Include="Cmdlets\Vault\GetAzureBackupVaultCredentials\VaultCredentials.cs" />
155160
<Compile Include="Cmdlets\Vault\SetAzureBackupVaultStorageType.cs" />
156161
<Compile Include="Library\AzureBackupCmdletHelper.cs" />
162+
<Compile Include="Library\AzureBackupContainerCmdletHelper.cs" />
157163
<Compile Include="Models\AzureBackupBaseObjects.cs" />
158164
<Compile Include="Models\AzureBackupContainer.cs" />
159165
<Compile Include="Models\AzureBackupEnums.cs" />
@@ -173,10 +179,6 @@
173179
<Compile Include="Properties\AssemblyInfo.cs" />
174180
</ItemGroup>
175181
<ItemGroup>
176-
<ProjectReference Include="..\..\..\..\..\azure-sdk-for-net\src\ResourceManagement\AzureBackup\BackupServicesManagment\BackupServicesManagment.csproj">
177-
<Project>{38a6741c-77a3-42a8-a846-83373be57c7f}</Project>
178-
<Name>BackupServicesManagment</Name>
179-
</ProjectReference>
180182
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
181183
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
182184
<Name>Commands.Common</Name>
@@ -202,8 +204,6 @@
202204
</EmbeddedResource>
203205
</ItemGroup>
204206
<ItemGroup>
205-
<Content Include="Resources\BackupManagementInterface.dll" />
206-
<Content Include="Resources\BMSCommonInterface.dll" />
207207
<Content Include="Resources\Microsoft.WindowsAzure.Management.Common.dll" />
208208
<Content Include="Resources\Security.Cryptography.dll" />
209209
</ItemGroup>

0 commit comments

Comments
 (0)