Skip to content

Commit b1b98b7

Browse files
committed
tests for problem classification
1 parent 9715b15 commit b1b98b7

File tree

6 files changed

+111
-21
lines changed

6 files changed

+111
-21
lines changed

src/Support/Support.Autorest/test/Get-AzSupportProblemClassification.Recording.json

Lines changed: 84 additions & 0 deletions
Large diffs are not rendered by default.

src/Support/Support.Autorest/test/Get-AzSupportProblemClassification.Tests.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzSupportProblemClassific
1515
}
1616

1717
Describe 'Get-AzSupportProblemClassification' {
18-
It 'List' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
18+
It 'List' {
19+
$problemClassifications = Get-AzSupportProblemClassification -ServiceName $env.BillingServiceId
20+
$problemClassifications.Count | Should -BeGreaterThan 1
2021
}
2122

2223
It 'GetViaIdentityService' -skip {
2324
{ throw [System.NotImplementedException] } | Should -Not -Throw
2425
}
2526

26-
It 'Get' -skip {
27-
{ throw [System.NotImplementedException] } | Should -Not -Throw
27+
It 'Get' {
28+
$problemClassification = Get-AzSupportProblemClassification -ServiceName $env.BillingServiceId -Name $env.BillingProblemClassificationId
29+
$problemClassification.Count | Should -Be 1
2830
}
2931

3032
It 'GetViaIdentity' -skip {

src/Support/Support.Autorest/test/Get-AzSupportService.Recording.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"isContentBase64": false,
88
"Headers": {
99
"x-ms-unique-id": [ "1" ],
10-
"x-ms-client-request-id": [ "47d76974-ba1c-455a-840d-a0ebba272757" ],
10+
"x-ms-client-request-id": [ "b4ce0743-e5fd-4afb-b251-d30aaa38cf0e" ],
1111
"CommandName": [ "Get-AzSupportService" ],
1212
"FullCommandName": [ "Get-AzSupportService_List" ],
1313
"ParameterSetName": [ "__AllParameterSets" ],
@@ -26,10 +26,10 @@
2626
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
2727
"Server": [ "Kestrel" ],
2828
"x-ms-ratelimit-remaining-tenant-reads": [ "11999" ],
29-
"x-ms-request-id": [ "29a30a49-679e-4f91-9d99-edac0b9a925a" ],
30-
"x-ms-correlation-request-id": [ "29a30a49-679e-4f91-9d99-edac0b9a925a" ],
31-
"x-ms-routing-request-id": [ "EASTUS:20240126T195803Z:29a30a49-679e-4f91-9d99-edac0b9a925a" ],
32-
"Date": [ "Fri, 26 Jan 2024 19:58:02 GMT" ]
29+
"x-ms-request-id": [ "5d0c55b1-c31d-4ed6-8c5c-bcdca20a2a0b" ],
30+
"x-ms-correlation-request-id": [ "5d0c55b1-c31d-4ed6-8c5c-bcdca20a2a0b" ],
31+
"x-ms-routing-request-id": [ "EASTUS:20240126T203957Z:5d0c55b1-c31d-4ed6-8c5c-bcdca20a2a0b" ],
32+
"Date": [ "Fri, 26 Jan 2024 20:39:57 GMT" ]
3333
},
3434
"ContentHeaders": {
3535
"Content-Length": [ "100765" ],
@@ -40,15 +40,15 @@
4040
"isContentBase64": false
4141
}
4242
},
43-
"Get-AzSupportService+[NoContext]+Get+$GET+https://management.azure.com/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc?api-version=2022-09-01-preview+1": {
43+
"Get-AzSupportService+[NoContext]+Get+$GET+https://management.azure.com/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc?api-version=2022-09-01-preview+1": {
4444
"Request": {
4545
"Method": "GET",
46-
"RequestUri": "https://management.azure.com/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc?api-version=2022-09-01-preview",
46+
"RequestUri": "https://management.azure.com/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc?api-version=2022-09-01-preview",
4747
"Content": null,
4848
"isContentBase64": false,
4949
"Headers": {
5050
"x-ms-unique-id": [ "2" ],
51-
"x-ms-client-request-id": [ "b83a71ce-9890-4baf-844d-7f57f1d16436" ],
51+
"x-ms-client-request-id": [ "e55e46b4-a52f-4b6f-a938-3250d17730d1" ],
5252
"CommandName": [ "Get-AzSupportService" ],
5353
"FullCommandName": [ "Get-AzSupportService_Get" ],
5454
"ParameterSetName": [ "__AllParameterSets" ],
@@ -67,17 +67,17 @@
6767
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
6868
"Server": [ "Kestrel" ],
6969
"x-ms-ratelimit-remaining-tenant-reads": [ "11998" ],
70-
"x-ms-request-id": [ "8da5f066-ef4d-4c45-85b3-d4f7e3f76c55" ],
71-
"x-ms-correlation-request-id": [ "8da5f066-ef4d-4c45-85b3-d4f7e3f76c55" ],
72-
"x-ms-routing-request-id": [ "EASTUS:20240126T195803Z:8da5f066-ef4d-4c45-85b3-d4f7e3f76c55" ],
73-
"Date": [ "Fri, 26 Jan 2024 19:58:02 GMT" ]
70+
"x-ms-request-id": [ "81ed0df1-1114-42c1-86e8-877f8d75e7d6" ],
71+
"x-ms-correlation-request-id": [ "81ed0df1-1114-42c1-86e8-877f8d75e7d6" ],
72+
"x-ms-routing-request-id": [ "EASTUS:20240126T203957Z:81ed0df1-1114-42c1-86e8-877f8d75e7d6" ],
73+
"Date": [ "Fri, 26 Jan 2024 20:39:57 GMT" ]
7474
},
7575
"ContentHeaders": {
76-
"Content-Length": [ "323" ],
76+
"Content-Length": [ "223" ],
7777
"Content-Type": [ "application/json; charset=utf-8" ],
7878
"Expires": [ "-1" ]
7979
},
80-
"Content": "{\"id\":\"/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc\",\"name\":\"cddd3eb5-1830-b494-44fd-782f691479dc\",\"type\":\"Microsoft.Support/services\",\"properties\":{\"displayName\":\"Virtual Machine running Linux\",\"resourceTypes\":[\"MICROSOFT.CLASSICCOMPUTE/VIRTUALMACHINES\",\"MICROSOFT.COMPUTE/VIRTUALMACHINES\"]}}",
80+
"Content": "{\"id\":\"/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc\",\"name\":\"517f2da6-78fd-0498-4e22-ad26996b1dfc\",\"type\":\"Microsoft.Support/services\",\"properties\":{\"displayName\":\"Billing\",\"resourceTypes\":[]}}",
8181
"isContentBase64": false
8282
}
8383
}

src/Support/Support.Autorest/test/Get-AzSupportService.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzSupportService'))
1717
Describe 'Get-AzSupportService' {
1818
It 'List' {
1919
$services = Get-AzSupportService
20-
$services.Count | Should -BeGreaterOrEqual 1
20+
$services.Count | Should -BeGreaterThan 1
2121
}
2222

2323
It 'Get' {
24-
$service = Get-AzSupportService -Name "cddd3eb5-1830-b494-44fd-782f691479dc"
24+
$service = Get-AzSupportService -Name $env.BillingServiceId
2525
$service.Count | Should -Be 1
2626
}
2727

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
22
"Tenant": "d71d46f6-114f-4d2a-81c9-8fc86ba8801c",
3-
"SubscriptionId": "4df09db9-7a7e-450b-8f88-00fb97c277bd"
3+
"SubscriptionId": "4df09db9-7a7e-450b-8f88-00fb97c277bd",
4+
"BillingProblemClassificationId": "d0f16bf7-e011-3f3b-1c26-3147f84e0896",
5+
"BillingServiceId": "517f2da6-78fd-0498-4e22-ad26996b1dfc"
46
}

src/Support/Support.Autorest/test/utils.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ function setupEnv() {
4343
# as default. You could change them if needed.
4444
$env.SubscriptionId = (Get-AzContext).Subscription.Id
4545
$env.Tenant = (Get-AzContext).Tenant.Id
46+
$env.BillingServiceId = "517f2da6-78fd-0498-4e22-ad26996b1dfc"
47+
$env.BillingProblemClassificationId = "d0f16bf7-e011-3f3b-1c26-3147f84e0896"
4648
# For any resources you created for test, you should add it to $env here.
4749
$envFile = 'env.json'
4850
if ($TestMode -eq 'live') {

0 commit comments

Comments
 (0)