@@ -15,15 +15,97 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzFrontDoorCdnOriginGroup
15
15
}
16
16
17
17
Describe ' Get-AzFrontDoorCdnOriginGroup' {
18
- It ' List' - skip {
19
- { throw [System.NotImplementedException ] } | Should -Not - Throw
18
+ It ' List' {
19
+ $ResourceGroupName = ' testps-rg-' + (RandomString - allChars $false - len 6 )
20
+ try
21
+ {
22
+ Write-Host - ForegroundColor Green " Create test group $ ( $ResourceGroupName ) "
23
+ New-AzResourceGroup - Name $ResourceGroupName - Location $env.location
24
+
25
+ $frontDoorCdnProfileName = ' fdp-' + (RandomString - allChars $false - len 6 );
26
+ Write-Host - ForegroundColor Green " Use frontDoorCdnProfileName : $ ( $frontDoorCdnProfileName ) "
27
+
28
+ $profileSku = " Standard_AzureFrontDoor" ;
29
+ New-AzFrontDoorCdnProfile - SkuName $profileSku - Name $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName - Location Global
30
+
31
+ $originGroupName = ' org' + (RandomString - allChars $false - len 6 );
32
+ New-AzFrontDoorCdnOriginGroup - OriginGroupName $originGroupName - ProfileName $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName `
33
+ - LoadBalancingSettingSampleSize 5 `
34
+ - LoadBalancingSettingSuccessfulSamplesRequired 4 `
35
+ - LoadBalancingSettingAdditionalLatencyInMillisecond 200 `
36
+ - HealthProbeSettingProbeIntervalInSecond 1 `
37
+ - HealthProbeSettingProbePath " /" `
38
+ - HealthProbeSettingProbeProtocol $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ProbeProtocol ]::Https) `
39
+ - HealthProbeSettingProbeRequestType $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.HealthProbeRequestType ]::Get) `
40
+
41
+ $originGroups = Get-AzFrontDoorCdnOriginGroup - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName
42
+ $originGroups.Count | Should - Be 1
43
+ } Finally
44
+ {
45
+ Remove-AzResourceGroup - Name $ResourceGroupName - NoWait
46
+ }
20
47
}
21
48
22
- It ' Get' - skip {
23
- { throw [System.NotImplementedException ] } | Should -Not - Throw
49
+ It ' Get' {
50
+ $ResourceGroupName = ' testps-rg-' + (RandomString - allChars $false - len 6 )
51
+ try
52
+ {
53
+ Write-Host - ForegroundColor Green " Create test group $ ( $ResourceGroupName ) "
54
+ New-AzResourceGroup - Name $ResourceGroupName - Location $env.location
55
+
56
+ $frontDoorCdnProfileName = ' fdp-' + (RandomString - allChars $false - len 6 );
57
+ Write-Host - ForegroundColor Green " Use frontDoorCdnProfileName : $ ( $frontDoorCdnProfileName ) "
58
+
59
+ $profileSku = " Standard_AzureFrontDoor" ;
60
+ New-AzFrontDoorCdnProfile - SkuName $profileSku - Name $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName - Location Global
61
+
62
+ $originGroupName = ' org' + (RandomString - allChars $false - len 6 );
63
+ New-AzFrontDoorCdnOriginGroup - OriginGroupName $originGroupName - ProfileName $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName `
64
+ - LoadBalancingSettingSampleSize 5 `
65
+ - LoadBalancingSettingSuccessfulSamplesRequired 4 `
66
+ - LoadBalancingSettingAdditionalLatencyInMillisecond 200 `
67
+ - HealthProbeSettingProbeIntervalInSecond 1 `
68
+ - HealthProbeSettingProbePath " /" `
69
+ - HealthProbeSettingProbeProtocol $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ProbeProtocol ]::Https) `
70
+ - HealthProbeSettingProbeRequestType $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.HealthProbeRequestType ]::Get) `
71
+
72
+ $originGroup = Get-AzFrontDoorCdnOriginGroup - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName
73
+ $originGroup.Name | Should - Be $originGroupName
74
+ } Finally
75
+ {
76
+ Remove-AzResourceGroup - Name $ResourceGroupName - NoWait
77
+ }
24
78
}
25
79
26
- It ' GetViaIdentity' - skip {
27
- { throw [System.NotImplementedException ] } | Should -Not - Throw
80
+ It ' GetViaIdentity' {
81
+ $PSDefaultParameterValues [' Disabled' ] = $true
82
+ $ResourceGroupName = ' testps-rg-' + (RandomString - allChars $false - len 6 )
83
+ try
84
+ {
85
+ Write-Host - ForegroundColor Green " Create test group $ ( $ResourceGroupName ) "
86
+ New-AzResourceGroup - Name $ResourceGroupName - Location $env.location
87
+
88
+ $frontDoorCdnProfileName = ' fdp-' + (RandomString - allChars $false - len 6 );
89
+ Write-Host - ForegroundColor Green " Use frontDoorCdnProfileName : $ ( $frontDoorCdnProfileName ) "
90
+
91
+ $profileSku = " Standard_AzureFrontDoor" ;
92
+ New-AzFrontDoorCdnProfile - SkuName $profileSku - Name $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName - Location Global
93
+
94
+ $originGroupName = ' org' + (RandomString - allChars $false - len 6 );
95
+ New-AzFrontDoorCdnOriginGroup - OriginGroupName $originGroupName - ProfileName $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName `
96
+ - LoadBalancingSettingSampleSize 5 `
97
+ - LoadBalancingSettingSuccessfulSamplesRequired 4 `
98
+ - LoadBalancingSettingAdditionalLatencyInMillisecond 200 `
99
+ - HealthProbeSettingProbeIntervalInSecond 1 `
100
+ - HealthProbeSettingProbePath " /" `
101
+ - HealthProbeSettingProbeProtocol $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ProbeProtocol ]::Https) `
102
+ - HealthProbeSettingProbeRequestType $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.HealthProbeRequestType ]::Get) `
103
+
104
+ $originGroup = Get-AzFrontDoorCdnOriginGroup - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName | Get-AzFrontDoorCdnOriginGroup
105
+ $originGroup.Name | Should - Be $originGroupName
106
+ } Finally
107
+ {
108
+ Remove-AzResourceGroup - Name $ResourceGroupName - NoWait
109
+ }
28
110
}
29
111
}
0 commit comments