@@ -57,26 +57,27 @@ function GetAzureRecoveryPointTest
57
57
$azureBackUpItem.ContainerType = $ContainerType
58
58
$azureBackUpItem.DataSourceId = $DataSourceId
59
59
$azureBackUpItem.Type = $DataSourceType
60
- $recoveryPoints = Get-AzureBackupRecoveryPoint - item $azureBackUpItem
60
+ $recoveryPoints = Get-AzureBackupRecoveryPoint - Item $azureBackUpItem
61
61
if (! ($recoveryPoints -eq $null ))
62
62
{
63
- foreach ($recoveryPoint in $recoveryPoints )
64
- {
65
- Assert-NotNull $recoveryPoint.RecoveryPointTime ' RecoveryPointTime should not be null'
66
- Assert-NotNull $recoveryPoint.RecoveryPointType ' RecoveryPointType should not be null'
67
- Assert-NotNull $recoveryPoint.RecoveryPointId ' RecoveryPointId should not be null'
63
+ foreach ($recoveryPoint in $recoveryPoints )
64
+ {
65
+ Assert-NotNull $recoveryPoint.RecoveryPointTime ' RecoveryPointTime should not be null'
66
+ Assert-NotNull $recoveryPoint.RecoveryPointType ' RecoveryPointType should not be null'
67
+ Assert-NotNull $recoveryPoint.RecoveryPointId ' RecoveryPointId should not be null'
68
+ }
68
69
}
69
70
}
70
71
71
- function Test-GetAzureBackupItemTests
72
+ function Test-GetAzureBackupItem
72
73
{
73
74
$azureBackUpContainer = New-Object Microsoft.Azure.Commands.AzureBackup.Cmdlets.AzureBackupContainer
74
75
$azureBackUpContainer.ResourceGroupName = $ResourceGroupName
75
76
$azureBackUpContainer.ResourceName = $ResourceName
76
77
$azureBackUpContainer.Location = $Location
77
78
$azureBackUpContainer.ContainerUniqueName = $ContainerName
78
79
$azureBackUpContainer.ContainerType = $ContainerType
79
- $item = Get-AzureBackupItem - container $azureBackUpContainer
80
+ $item = Get-AzureBackupItem - Container $azureBackUpContainer
80
81
if (! ($item -eq $null ))
81
82
{
82
83
foreach ($backupitem in $item )
@@ -85,15 +86,15 @@ function Test-GetAzureBackupItemTests
85
86
Assert-NotNull $backupitem.Name ' Name should not be null'
86
87
Assert-NotNull $backupitem.Type ' Type should not be null'
87
88
Assert-NotNull $backupitem.ContainerType ' ContainerType should not be null'
88
- Assert-NotNull $backupitem.ContainerUniqueName ' ContainerUniqueName should not be null'
89
- Assert-NotNull $backupitem.ResourceGroupName ' ResourceGroupName should not be null'
90
- Assert-NotNull $backupitem.ResourceName ' ResourceName should not be null'
91
- Assert-NotNull $backupitem.Location ' Location should not be null'
89
+ Assert-NotNull $backupitem.ContainerUniqueName ' ContainerUniqueName should not be null'
90
+ Assert-NotNull $backupitem.ResourceGroupName ' ResourceGroupName should not be null'
91
+ Assert-NotNull $backupitem.ResourceName ' ResourceName should not be null'
92
+ Assert-NotNull $backupitem.Location ' Location should not be null'
92
93
}
93
94
}
94
95
}
95
96
96
- function Test-EnableDisableAzureBackupProtectionTest
97
+ function Test-EnableAzureBackupProtection
97
98
{
98
99
$policy = New-Object Microsoft.Azure.Commands.AzureBackup.Cmdlets.AzureBackupProtectionPolicy
99
100
$policy.InstanceId = $PolicyId
@@ -114,13 +115,22 @@ function Test-EnableDisableAzureBackupProtectionTest
114
115
$azureBackUpItem.DataSourceId = $DataSourceId
115
116
$azureBackUpItem.Type = $DataSourceType
116
117
$azureBackUpItem.Name = $POName
117
-
118
- $jobId = Enable-AzureBackupProtection - item $azureBackUpItem - Policy $policy
119
- sleep(20 )
120
- $jobId1 = Disable-AzureBackupProtection - item $azureBackUpItem
121
- sleep(20 )
122
- $jobId2 = Enable-AzureBackupProtection - item $azureBackUpItem - Policy $policy
118
+ $jobId = Enable-AzureBackupProtection - Item $azureBackUpItem - Policy $policy
119
+
123
120
}
121
+
122
+ function Test-DisableAzureBackupProtection
123
+ {
124
+ $azureBackUpItem = New-Object Microsoft.Azure.Commands.AzureBackup.Cmdlets.AzureBackupItem
125
+ $azureBackUpItem.ResourceGroupName = $ResourceGroupName
126
+ $azureBackUpItem.ResourceName = $ResourceName
127
+ $azureBackUpItem.Location = $Location
128
+ $azureBackUpItem.ContainerUniqueName = $ContainerName
129
+ $azureBackUpItem.ContainerType = $ContainerType
130
+ $azureBackUpItem.DataSourceId = $DataSourceId
131
+ $azureBackUpItem.Type = $DataSourceType
132
+ $azureBackUpItem.Name = $POName
133
+ $jobId1 = Disable-AzureBackupProtection - Item $azureBackUpItem
124
134
}
125
135
126
136
function BackUpAzureBackUpItemTest
@@ -133,7 +143,7 @@ function BackUpAzureBackUpItemTest
133
143
$azureBackUpItem.ContainerType = $ContainerType
134
144
$azureBackUpItem.DataSourceId = $DataSourceId
135
145
$azureBackUpItem.Type = $DataSourceType
136
- $jobId = Backup-AzureBackupItem - item $azureBackUpItem
146
+ $jobId = Backup-AzureBackupItem - Item $azureBackUpItem
137
147
}
138
148
139
149
@@ -220,4 +230,4 @@ function Test-SetAzureBackupVaultStorageTypeWithLockedResourceThrowsException
220
230
Assert-Throws { Set-AzureBackupVaultStorageType - ResourceGroupName $ResourceGroupName - ResourceName $ResourceName - Location $Location - Type GeoRedundant }
221
231
222
232
Assert-Throws { Set-AzureBackupVaultStorageType - ResourceGroupName $ResourceGroupName - ResourceName $ResourceName - Location $Location - Type LocallyRedundant }
223
- }
233
+ }
0 commit comments