File tree Expand file tree Collapse file tree 1 file changed +31
-2
lines changed
src/Cdn/Cdn.Autorest/test Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,36 @@ if(($null -eq $TestName) -or ($TestName -contains 'New-AzCdnEndpoint'))
15
15
}
16
16
17
17
Describe ' New-AzCdnEndpoint' {
18
- It ' CreateExpanded' - skip {
19
- { throw [System.NotImplementedException ] } | Should -Not - Throw
18
+ It ' CreateExpanded' {
19
+ {
20
+ $ResourceGroupName = ' testps-rg-' + (RandomString - allChars $false - len 6 )
21
+ try
22
+ {
23
+ Write-Host - ForegroundColor Green " Create test group $ ( $ResourceGroupName ) "
24
+ New-AzResourceGroup - Name $ResourceGroupName - Location $env.location
25
+
26
+ $cdnProfileName = ' p-' + (RandomString - allChars $false - len 6 );
27
+ Write-Host - ForegroundColor Green " Use cdnProfileName : $ ( $cdnProfileName ) "
28
+
29
+ $profileSku = " Standard_Microsoft" ;
30
+ New-AzCdnProfile - SkuName $profileSku - Name $cdnProfileName - ResourceGroupName $ResourceGroupName - Location Global
31
+
32
+ $endpointName = ' e-' + (RandomString - allChars $false - len 6 );
33
+ $origin = @ {
34
+ Name = " origin1"
35
+ HostName = " host1.hello.com"
36
+ };
37
+ Write-Host - ForegroundColor Green " Create endpointName : $ ( $endpointName ) , origin.Name : $ ( $origin.Name ) , origin.HostName : $ ( $origin.HostName ) "
38
+
39
+ $endpoint = New-AzCdnEndpoint - Name $endpointName - ResourceGroupName $ResourceGroupName - ProfileName $cdnProfileName - Location $env.location - Origin $origin
40
+ $endpoint.Name | Should - Be $endpointName
41
+ $endpoint.Location | Should - Be $env.location
42
+ $endpoint.Origin.Name | Should - Be $origin.Name
43
+ $endpoint.Origin.HostName | Should - Be $origin.HostName
44
+ } Finally
45
+ {
46
+ Remove-AzResourceGroup - Name $ResourceGroupName - NoWait
47
+ }
48
+ } | Should -Not - Throw
20
49
}
21
50
}
You can’t perform that action at this time.
0 commit comments