Skip to content

Commit 4b2da43

Browse files
committed
Test Get-AzureVM for PaaS deployment
1 parent f7ece7b commit 4b2da43

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,12 @@ public void AzureDeploymentTest()
626626
Assert.IsTrue(ce.Message.Contains("The date specified in parameter EndTime is not within the correct range."));
627627
}
628628

629+
// Negative test for Get-AzureVM
630+
var vmRoleList1 = vmPowershellCmdlets.GetAzureVM();
631+
Assert.IsFalse(vmRoleList1.Any(r => r.DeploymentName == deploymentName));
632+
var vmRoleList2 = vmPowershellCmdlets.GetAzureVM(serviceName);
633+
Assert.IsFalse(vmRoleList2.Any(r => r.DeploymentName == deploymentName));
634+
629635
vmPowershellCmdlets.RemoveAzureDeployment(serviceName, DeploymentSlotType.Production, true);
630636

631637
pass &= Utilities.CheckRemove(vmPowershellCmdlets.GetAzureDeployment, serviceName, DeploymentSlotType.Production);

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,9 +1330,9 @@ internal Collection<ManagementOperationContext> NewAzureVM(string serviceName, S
13301330
return result;
13311331
}
13321332

1333-
public Collection<SM.PersistentVMRoleListContext> GetAzureVM(string vmName = null)
1333+
public Collection<SM.PersistentVMRoleListContext> GetAzureVM(string serviceName = null)
13341334
{
1335-
return RunPSCmdletAndReturnAll<SM.PersistentVMRoleListContext>(new GetAzureVMCmdletInfo(vmName, null));
1335+
return RunPSCmdletAndReturnAll<SM.PersistentVMRoleListContext>(new GetAzureVMCmdletInfo(null, serviceName));
13361336
}
13371337

13381338
public SM.PersistentVMRoleContext GetAzureVM(string vmName, string serviceName)

0 commit comments

Comments
 (0)