Skip to content

Commit 1d8bed2

Browse files
committed
tests for new file workspace
1 parent d19fb89 commit 1d8bed2

6 files changed

+105
-7
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"New-AzSupportFileWorkspace+[NoContext]+Create+$PUT+https://management.azure.com/subscriptions/4df09db9-7a7e-450b-8f88-00fb97c277bd/providers/Microsoft.Support/fileWorkspaces/test-ps-788d2c69-ffb3-4b2e-96a0-769089ff7a7a?api-version=2022-09-01-preview+1": {
3+
"Request": {
4+
"Method": "PUT",
5+
"RequestUri": "https://management.azure.com/subscriptions/4df09db9-7a7e-450b-8f88-00fb97c277bd/providers/Microsoft.Support/fileWorkspaces/test-ps-788d2c69-ffb3-4b2e-96a0-769089ff7a7a?api-version=2022-09-01-preview",
6+
"Content": null,
7+
"isContentBase64": false,
8+
"Headers": {
9+
"x-ms-unique-id": [ "1" ],
10+
"x-ms-client-request-id": [ "404e71fa-2256-4f86-975a-efddc3ddead2" ],
11+
"CommandName": [ "New-AzSupportFileWorkspace" ],
12+
"FullCommandName": [ "New-AzSupportFileWorkspace_Create" ],
13+
"ParameterSetName": [ "__AllParameterSets" ],
14+
"User-Agent": [ "AzurePowershell/v11.2.0", "PSVersion/v7.3.11", "Az.Support/0.1.0" ],
15+
"Authorization": [ "[Filtered]" ]
16+
},
17+
"ContentHeaders": {
18+
}
19+
},
20+
"Response": {
21+
"StatusCode": 201,
22+
"Headers": {
23+
"Cache-Control": [ "no-cache" ],
24+
"Pragma": [ "no-cache" ],
25+
"Location": [ "https://management.azure.com/subscriptions/4df09db9-7a7e-450b-8f88-00fb97c277bd/providers/Microsoft.Support/fileWorkspaces/test-ps-788d2c69-ffb3-4b2e-96a0-769089ff7a7a?api-version=2022-09-01-preview" ],
26+
"X-Content-Type-Options": [ "nosniff" ],
27+
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
28+
"Server": [ "Kestrel" ],
29+
"x-ms-ratelimit-remaining-subscription-writes": [ "1199" ],
30+
"x-ms-request-id": [ "acf571a2-cd60-48a9-969c-fa62dcb4ef9e" ],
31+
"x-ms-correlation-request-id": [ "acf571a2-cd60-48a9-969c-fa62dcb4ef9e" ],
32+
"x-ms-routing-request-id": [ "EASTUS:20240129T212426Z:acf571a2-cd60-48a9-969c-fa62dcb4ef9e" ],
33+
"Date": [ "Mon, 29 Jan 2024 21:24:25 GMT" ]
34+
},
35+
"ContentHeaders": {
36+
"Content-Length": [ "334" ],
37+
"Content-Type": [ "application/json; charset=utf-8" ],
38+
"Expires": [ "-1" ]
39+
},
40+
"Content": "{\"id\":\"/subscriptions/4df09db9-7a7e-450b-8f88-00fb97c277bd/providers/Microsoft.Support/fileWorkspaces/test-ps-788d2c69-ffb3-4b2e-96a0-769089ff7a7a\",\"name\":\"test-ps-788d2c69-ffb3-4b2e-96a0-769089ff7a7a\",\"type\":\"Microsoft.Support/fileWorkspaces\",\"properties\":{\"expirationTime\":\"2024-01-30T21:24:25Z\",\"createdOn\":\"2024-01-29T21:24:25Z\"}}",
41+
"isContentBase64": false
42+
}
43+
}
44+
}

src/Support/Support.Autorest/test/New-AzSupportFileWorkspace.Tests.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ if(($null -eq $TestName) -or ($TestName -contains 'New-AzSupportFileWorkspace'))
1515
}
1616

1717
Describe 'New-AzSupportFileWorkspace' {
18-
It 'Create' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
18+
It 'Create' {
19+
$fileWorkspaceName = "test-ps-$(New-Guid)"
20+
$fileWorkspace = New-AzSupportFileWorkspace -Name $fileWorkspaceName -SubscriptionId $env.SubscriptionId
21+
$fileWorkspace.Name | Should -Be $fileWorkspaceName
2022
}
2123
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"New-AzSupportFileWorkspacesNoSubscription+[NoContext]+Create+$PUT+https://management.azure.com/providers/Microsoft.Support/fileWorkspaces/test-ps-a169629b-d263-4ba1-872a-0d79019ca2d3?api-version=2022-09-01-preview+1": {
3+
"Request": {
4+
"Method": "PUT",
5+
"RequestUri": "https://management.azure.com/providers/Microsoft.Support/fileWorkspaces/test-ps-a169629b-d263-4ba1-872a-0d79019ca2d3?api-version=2022-09-01-preview",
6+
"Content": null,
7+
"isContentBase64": false,
8+
"Headers": {
9+
"x-ms-unique-id": [ "1" ],
10+
"x-ms-client-request-id": [ "6003c6f3-0370-42db-9fb6-2e20da8b2a7b" ],
11+
"CommandName": [ "New-AzSupportFileWorkspacesNoSubscription" ],
12+
"FullCommandName": [ "New-AzSupportFileWorkspacesNoSubscription_Create" ],
13+
"ParameterSetName": [ "__AllParameterSets" ],
14+
"User-Agent": [ "AzurePowershell/v11.2.0", "PSVersion/v7.3.11", "Az.Support/0.1.0" ],
15+
"Authorization": [ "[Filtered]" ]
16+
},
17+
"ContentHeaders": {
18+
}
19+
},
20+
"Response": {
21+
"StatusCode": 201,
22+
"Headers": {
23+
"Cache-Control": [ "no-cache" ],
24+
"Pragma": [ "no-cache" ],
25+
"Location": [ "https://management.azure.com/providers/Microsoft.Support/fileWorkspaces/test-ps-a169629b-d263-4ba1-872a-0d79019ca2d3?api-version=2022-09-01-preview" ],
26+
"X-Content-Type-Options": [ "nosniff" ],
27+
"Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ],
28+
"Server": [ "Kestrel" ],
29+
"x-ms-ratelimit-remaining-tenant-writes": [ "1199" ],
30+
"x-ms-request-id": [ "14af729f-4c8b-487d-a086-58b16d9d19f8" ],
31+
"x-ms-correlation-request-id": [ "14af729f-4c8b-487d-a086-58b16d9d19f8" ],
32+
"x-ms-routing-request-id": [ "EASTUS:20240129T212541Z:14af729f-4c8b-487d-a086-58b16d9d19f8" ],
33+
"Date": [ "Mon, 29 Jan 2024 21:25:40 GMT" ]
34+
},
35+
"ContentHeaders": {
36+
"Content-Length": [ "283" ],
37+
"Content-Type": [ "application/json; charset=utf-8" ],
38+
"Expires": [ "-1" ]
39+
},
40+
"Content": "{\"id\":\"/providers/Microsoft.Support/fileWorkspaces/test-ps-a169629b-d263-4ba1-872a-0d79019ca2d3\",\"name\":\"test-ps-a169629b-d263-4ba1-872a-0d79019ca2d3\",\"type\":\"Microsoft.Support/fileWorkspaces\",\"properties\":{\"expirationTime\":\"2024-01-30T21:25:41Z\",\"createdOn\":\"2024-01-29T21:25:41Z\"}}",
41+
"isContentBase64": false
42+
}
43+
}
44+
}

src/Support/Support.Autorest/test/New-AzSupportFileWorkspacesNoSubscription.Tests.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ if(($null -eq $TestName) -or ($TestName -contains 'New-AzSupportFileWorkspacesNo
1515
}
1616

1717
Describe 'New-AzSupportFileWorkspacesNoSubscription' {
18-
It 'Create' -skip {
19-
{ throw [System.NotImplementedException] } | Should -Not -Throw
18+
It 'Create' {
19+
$fileWorkspaceName = "test-ps-$(New-Guid)"
20+
$fileWorkspace = New-AzSupportFileWorkspacesNoSubscription -Name $fileWorkspaceName
21+
$fileWorkspace.Name | Should -Be $fileWorkspaceName
2022
}
2123
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"Tenant": "d71d46f6-114f-4d2a-81c9-8fc86ba8801c",
2+
"BillingServiceId": "517f2da6-78fd-0498-4e22-ad26996b1dfc",
33
"SubscriptionId": "4df09db9-7a7e-450b-8f88-00fb97c277bd",
4-
"BillingProblemClassificationId": "d0f16bf7-e011-3f3b-1c26-3147f84e0896",
5-
"BillingServiceId": "517f2da6-78fd-0498-4e22-ad26996b1dfc"
4+
"Tenant": "d71d46f6-114f-4d2a-81c9-8fc86ba8801c",
5+
"BillingProblemClassificationId": "d0f16bf7-e011-3f3b-1c26-3147f84e0896"
66
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"SubscriptionId": "4df09db9-7a7e-450b-8f88-00fb97c277bd",
3+
"Tenant": "d71d46f6-114f-4d2a-81c9-8fc86ba8801c",
4+
"BillingProblemClassificationId": "d0f16bf7-e011-3f3b-1c26-3147f84e0896",
5+
"BillingServiceId": "517f2da6-78fd-0498-4e22-ad26996b1dfc"
6+
}

0 commit comments

Comments
 (0)