@@ -59,8 +59,11 @@ function Test-CRUDNamespace
59
59
Write-Debug " NamespaceName : $namespaceName "
60
60
$result = New-AzureRmNotificationHubsNamespace - ResourceGroup $resourceGroupName - Namespace $namespaceName - Location $location
61
61
62
- Start-Sleep - Seconds 15
63
-
62
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
63
+ {
64
+ Start-Sleep - Seconds 15
65
+ }
66
+
64
67
Write-Debug " Get the created namespace within the resource group"
65
68
$createdNamespace = Get-AzureRmNotificationHubsNamespace - ResourceGroup $resourceGroupName - Namespace $namespaceName
66
69
Assert-True {$createdNamespace.Count -eq 1 }
@@ -90,7 +93,10 @@ function Test-CRUDNamespace
90
93
Write-Debug " Namespace name : $namespaceName2 "
91
94
$result = New-AzureRmNotificationHubsNamespace - ResourceGroup $secondResourceGroup - Namespace $namespaceName2 - Location $location
92
95
93
- Start-Sleep - Seconds 15
96
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
97
+ {
98
+ Start-Sleep - Seconds 15
99
+ }
94
100
95
101
Write-Debug " Get all the namespaces created in the resourceGroup"
96
102
$allCreatedNamespace = Get-AzureRmNotificationHubsNamespace - ResourceGroup $secondResourceGroup
@@ -145,7 +151,10 @@ function Test-CRUDNamespace
145
151
$updatedNamespace = Set-AzureRmNotificationHubsNamespace - ResourceGroup $secondResourceGroup - Namespace $namespaceName2 - Location $location - Tags $tags
146
152
Assert-AreEqual 2 $updatedNamespace.Tags.Count
147
153
148
- Start-Sleep - Seconds 15
154
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
155
+ {
156
+ Start-Sleep - Seconds 15
157
+ }
149
158
150
159
Write-Debug " Get the updated namespace "
151
160
$getUpdatedNamespace = Get-AzureRmNotificationHubsNamespace - ResourceGroup $secondResourceGroup - Namespace $namespaceName2
@@ -181,7 +190,10 @@ function Test-CRUDNamespaceAuth
181
190
182
191
$result = New-AzureRmNotificationHubsNamespace - ResourceGroup $resourceGroupName - Namespace $namespaceName - Location $location
183
192
184
- Start-Sleep - Seconds 15
193
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
194
+ {
195
+ Start-Sleep - Seconds 15
196
+ }
185
197
186
198
Write-Debug " Get the created namespace within the resource group"
187
199
$createdNamespace = Get-AzureRmNotificationHubsNamespace - ResourceGroup $resourceGroupName - Namespace $namespaceName
@@ -282,7 +294,10 @@ function Test-CRUDNamespaceAuth
282
294
Assert-AreEqual $newPrimaryKey $updatedAuthRule.PrimaryKey
283
295
Assert-NotNull $updatedAuthRule.SecondaryKey
284
296
285
- Start-Sleep - Seconds 15
297
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
298
+ {
299
+ Start-Sleep - Seconds 15
300
+ }
286
301
287
302
Write-Debug " Get updated Namespace AuthorizationRules"
288
303
$updatedAuthRule = Get-AzureRmNotificationHubsNamespaceAuthorizationRules - ResourceGroup $resourceGroupName - Namespace $namespaceName - AuthorizationRule $authRuleName
@@ -332,7 +347,10 @@ function Test-CRUDNotificationHub
332
347
Write-Debug " Namespace name : $namespaceName "
333
348
$result = New-AzureRmNotificationHubsNamespace - ResourceGroup $resourceGroupName - Namespace $namespaceName - Location $location
334
349
335
- Start-Sleep - Seconds 15
350
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
351
+ {
352
+ Start-Sleep - Seconds 15
353
+ }
336
354
337
355
Write-Debug " Get the created namespace within the resource group"
338
356
$createdNamespace = Get-AzureRmNotificationHubsNamespace - ResourceGroup $resourceGroupName - Namespace $namespaceName
@@ -408,7 +426,10 @@ function Test-CRUDNotificationHub
408
426
$createdNotificationHub.WnsCredential.Properties.WindowsLiveEndpoint = " http://pushtestservice.cloudapp.net/LiveID/accesstoken.srf"
409
427
$result = Set-AzureRmNotificationHub - ResourceGroup $resourceGroupName - Namespace $namespaceName - NotificationHubObj $createdNotificationHub
410
428
411
- Start-Sleep - Seconds 15
429
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
430
+ {
431
+ Start-Sleep - Seconds 15
432
+ }
412
433
413
434
Write-Debug " Get the PNS credentials for the first notificationHub created"
414
435
$pnsCredentials = Get-AzureRmNotificationHubPNSCredentials - ResourceGroup $resourceGroupName - Namespace $namespaceName - NotificationHub $notificationHubName
@@ -447,7 +468,10 @@ function Test-CRUDNHAuth
447
468
Write-Debug " Namespace name : $namespaceName "
448
469
$result = New-AzureRmNotificationHubsNamespace - ResourceGroup $resourceGroupName - Namespace $namespaceName - Location $location
449
470
450
- Start-Sleep - Seconds 15
471
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
472
+ {
473
+ Start-Sleep - Seconds 15
474
+ }
451
475
452
476
Write-Debug " Get the created namespace within the resource group"
453
477
$createdNamespace = Get-AzureRmNotificationHubsNamespace - ResourceGroup $resourceGroupName - Namespace $namespaceName
@@ -485,7 +509,10 @@ function Test-CRUDNHAuth
485
509
Assert-True { $result.Rights -Contains " Listen" }
486
510
Assert-True { $result.Rights -Contains " Send" }
487
511
488
- Start-Sleep - Seconds 15
512
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
513
+ {
514
+ Start-Sleep - Seconds 15
515
+ }
489
516
490
517
Write-Debug " Get created authorizationRule"
491
518
$createdAuthRule = Get-AzureRmNotificationHubAuthorizationRules - ResourceGroup $resourceGroupName - Namespace $namespaceName - NotificationHub $notificationHubName - AuthorizationRule $authRuleName
@@ -533,7 +560,10 @@ function Test-CRUDNHAuth
533
560
Assert-AreEqual $newPrimaryKey $updatedAuthRule.PrimaryKey
534
561
Assert-NotNull $updatedAuthRule.SecondaryKey
535
562
536
- Start-Sleep - Seconds 15
563
+ if ($env: AZURE_TEST_MODE -ne " Playback" )
564
+ {
565
+ Start-Sleep - Seconds 15
566
+ }
537
567
538
568
$updatedAuthRule = Get-AzureRmNotificationHubAuthorizationRules - ResourceGroup $resourceGroupName - Namespace $namespaceName - NotificationHub $notificationHubName - AuthorizationRule $authRuleName
539
569
0 commit comments