Skip to content

Commit 409fbd4

Browse files
authored
Merge pull request Azure#8 from deathly809/Azs.SubAdmin.Tests
Add subscription admin powershell tests
2 parents a1fae68 + 5e56f99 commit 409fbd4

26 files changed

+2695
-680
lines changed

src/StackAdmin/Azs.Subscriptions.Admin/Tests/Azs.Subscriptions.Admin.Tests.csproj

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build"
3-
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
43
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
54
<PropertyGroup>
65
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -63,6 +62,25 @@
6362
<None Include="packages.config">
6463
<SubType>Designer</SubType>
6564
</None>
65+
<None Include="SessionRecords\SubscriptionsAdminClient\TestCreateUpdateThenDeleteDirectoryTenant.json" />
66+
<None Include="SessionRecords\SubscriptionsAdminClient\TestCreateUpdateThenDeleteOffer.json" />
67+
<None Include="SessionRecords\SubscriptionsAdminClient\TestCreateUpdateThenDeletePlan.json" />
68+
<None Include="SessionRecords\SubscriptionsAdminClient\TestGetAcquiredPlan.json" />
69+
<None Include="SessionRecords\SubscriptionsAdminClient\TestGetAllAcquiredPlans.json" />
70+
<None Include="SessionRecords\SubscriptionsAdminClient\TestGetAllDelegatedProviders.json" />
71+
<None Include="SessionRecords\SubscriptionsAdminClient\TestGetAllDirectoryTenants.json" />
72+
<None Include="SessionRecords\SubscriptionsAdminClient\TestGetAllLocations.json" />
73+
<None Include="SessionRecords\SubscriptionsAdminClient\TestGetLocation.json" />
74+
<None Include="SessionRecords\SubscriptionsAdminClient\TestGetOffer.json" />
75+
<None Include="SessionRecords\SubscriptionsAdminClient\TestListAcquiredPlans.json" />
76+
<None Include="SessionRecords\SubscriptionsAdminClient\TestListDelegatedProviderOffers.json" />
77+
<None Include="SessionRecords\SubscriptionsAdminClient\TestListDelegatedProviders.json" />
78+
<None Include="SessionRecords\SubscriptionsAdminClient\TestListDirectoryTenants.json" />
79+
<None Include="SessionRecords\SubscriptionsAdminClient\TestListLocations.json" />
80+
<None Include="SessionRecords\SubscriptionsAdminClient\TestListOffers.json" />
81+
<None Include="SessionRecords\SubscriptionsAdminClient\TestListPlans.json" />
82+
<None Include="SessionRecords\SubscriptionsAdminClient\TestListQuotas.json" />
83+
<None Include="SessionRecords\SubscriptionsAdminClient\TestListSubscriptions.json" />
6684
<None Include="src\*.ps1" />
6785
</ItemGroup>
6886
<ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/providers/Microsoft.Subscriptions.Admin/plans?api-version=2015-11-01",
5+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOGFiMjU1MWQtNDFlNS00ODliLTkyNzMtMWNkZjFjYmM3ZGM2L3Byb3ZpZGVycy9NaWNyb3NvZnQuU3Vic2NyaXB0aW9ucy5BZG1pbi9wbGFucz9hcGktdmVyc2lvbj0yMDE1LTExLTAx",
6+
"RequestMethod": "GET",
7+
"RequestBody": "",
8+
"RequestHeaders": {
9+
"x-ms-client-request-id": [
10+
"5416af8f-479b-4f39-9bd4-fae3e6b5674f"
11+
],
12+
"accept-language": [
13+
"en-US"
14+
],
15+
"User-Agent": [
16+
"FxVersion/4.6.26011.01",
17+
"Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient/0.1.0.0"
18+
]
19+
},
20+
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/resourceGroups/Plans/providers/Microsoft.Subscriptions.Admin/plans/testplan\",\r\n \"name\": \"testplan\",\r\n \"type\": \"Microsoft.Subscriptions.Admin/plans\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"name\": \"testplan\",\r\n \"displayName\": \"TestPlan\",\r\n \"subscriptionCount\": 0,\r\n \"quotaIds\": [\r\n \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/providers/Microsoft.Compute.Admin/locations/local/quotas/Default Quota\",\r\n \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/providers/Microsoft.KeyVault.Admin/locations/local/quotas/Unlimited\",\r\n \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/providers/Microsoft.Network.Admin/locations/local/quotas/Default Quota\",\r\n \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/providers/Microsoft.Storage.Admin/locations/local/quotas/Default Quota\",\r\n \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/providers/Microsoft.Subscriptions.Admin/locations/local/quotas/delegatedProviderQuota\"\r\n ]\r\n }\r\n }\r\n ]\r\n}",
21+
"ResponseHeaders": {
22+
"Content-Length": [
23+
"960"
24+
],
25+
"Content-Type": [
26+
"application/json; charset=utf-8"
27+
],
28+
"Expires": [
29+
"-1"
30+
],
31+
"Cache-Control": [
32+
"no-cache"
33+
],
34+
"Date": [
35+
"Tue, 13 Mar 2018 18:52:52 GMT"
36+
],
37+
"Pragma": [
38+
"no-cache"
39+
],
40+
"x-ms-ratelimit-remaining-subscription-reads": [
41+
"14762"
42+
],
43+
"x-ms-request-id": [
44+
"d33fad7e-ca0f-4433-a4c3-4ebd93f41969"
45+
],
46+
"x-ms-correlation-request-id": [
47+
"d33fad7e-ca0f-4433-a4c3-4ebd93f41969"
48+
],
49+
"x-ms-routing-request-id": [
50+
"LOCAL:20180313T185253Z:d33fad7e-ca0f-4433-a4c3-4ebd93f41969"
51+
],
52+
"Strict-Transport-Security": [
53+
"max-age=31536000; includeSubDomains"
54+
],
55+
"X-Content-Type-Options": [
56+
"nosniff"
57+
]
58+
},
59+
"StatusCode": 200
60+
},
61+
{
62+
"RequestUri": "/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/resourcegroups/testrg/providers/Microsoft.Subscriptions.Admin/offers/testOffer1?api-version=2015-11-01",
63+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOGFiMjU1MWQtNDFlNS00ODliLTkyNzMtMWNkZjFjYmM3ZGM2L3Jlc291cmNlZ3JvdXBzL3Rlc3RyZy9wcm92aWRlcnMvTWljcm9zb2Z0LlN1YnNjcmlwdGlvbnMuQWRtaW4vb2ZmZXJzL3Rlc3RPZmZlcjE/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
64+
"RequestMethod": "PUT",
65+
"RequestBody": "{\r\n \"properties\": {\r\n \"name\": \"testOffer1\",\r\n \"displayName\": \"Test Offer\",\r\n \"description\": \"This is a test Offer\",\r\n \"maxSubscriptionsPerAccount\": 100,\r\n \"basePlanIds\": [\r\n \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/resourceGroups/Plans/providers/Microsoft.Subscriptions.Admin/plans/testplan\"\r\n ]\r\n },\r\n \"location\": \"local\"\r\n}",
66+
"RequestHeaders": {
67+
"Content-Type": [
68+
"application/json; charset=utf-8"
69+
],
70+
"Content-Length": [
71+
"363"
72+
],
73+
"x-ms-client-request-id": [
74+
"b5c02dee-2fe3-4d55-80da-36458a99fcb6"
75+
],
76+
"accept-language": [
77+
"en-US"
78+
],
79+
"User-Agent": [
80+
"FxVersion/4.6.26011.01",
81+
"Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient/0.1.0.0"
82+
]
83+
},
84+
"ResponseBody": "{\r\n \"id\": \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/resourceGroups/testrg/providers/Microsoft.Subscriptions.Admin/offers/testOffer1\",\r\n \"name\": \"testOffer1\",\r\n \"type\": \"Microsoft.Subscriptions.Admin/offers\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"name\": \"testOffer1\",\r\n \"displayName\": \"Test Offer\",\r\n \"description\": \"This is a test Offer\",\r\n \"state\": \"Private\",\r\n \"subscriptionCount\": 0,\r\n \"maxSubscriptionsPerAccount\": 100,\r\n \"basePlanIds\": [\r\n \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/resourceGroups/Plans/providers/Microsoft.Subscriptions.Admin/plans/testplan\"\r\n ],\r\n \"addonPlans\": []\r\n }\r\n}",
85+
"ResponseHeaders": {
86+
"Content-Length": [
87+
"559"
88+
],
89+
"Content-Type": [
90+
"application/json; charset=utf-8"
91+
],
92+
"Expires": [
93+
"-1"
94+
],
95+
"Cache-Control": [
96+
"no-cache"
97+
],
98+
"Date": [
99+
"Tue, 13 Mar 2018 18:52:52 GMT"
100+
],
101+
"Pragma": [
102+
"no-cache"
103+
],
104+
"x-ms-ratelimit-remaining-subscription-writes": [
105+
"1188"
106+
],
107+
"x-ms-request-id": [
108+
"b61bed86-34cd-4422-bc64-93606da12192"
109+
],
110+
"x-ms-correlation-request-id": [
111+
"b61bed86-34cd-4422-bc64-93606da12192"
112+
],
113+
"x-ms-routing-request-id": [
114+
"LOCAL:20180313T185253Z:b61bed86-34cd-4422-bc64-93606da12192"
115+
],
116+
"Strict-Transport-Security": [
117+
"max-age=31536000; includeSubDomains"
118+
],
119+
"X-Content-Type-Options": [
120+
"nosniff"
121+
]
122+
},
123+
"StatusCode": 200
124+
},
125+
{
126+
"RequestUri": "/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/resourcegroups/testrg/providers/Microsoft.Subscriptions.Admin/offers/testOffer1?api-version=2015-11-01",
127+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOGFiMjU1MWQtNDFlNS00ODliLTkyNzMtMWNkZjFjYmM3ZGM2L3Jlc291cmNlZ3JvdXBzL3Rlc3RyZy9wcm92aWRlcnMvTWljcm9zb2Z0LlN1YnNjcmlwdGlvbnMuQWRtaW4vb2ZmZXJzL3Rlc3RPZmZlcjE/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
128+
"RequestMethod": "GET",
129+
"RequestBody": "",
130+
"RequestHeaders": {
131+
"x-ms-client-request-id": [
132+
"74563131-fc95-4619-8e73-1835f431ec3d"
133+
],
134+
"accept-language": [
135+
"en-US"
136+
],
137+
"User-Agent": [
138+
"FxVersion/4.6.26011.01",
139+
"Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient/0.1.0.0"
140+
]
141+
},
142+
"ResponseBody": "{\r\n \"id\": \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/resourceGroups/testrg/providers/Microsoft.Subscriptions.Admin/offers/testOffer1\",\r\n \"name\": \"testOffer1\",\r\n \"type\": \"Microsoft.Subscriptions.Admin/offers\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"name\": \"testOffer1\",\r\n \"displayName\": \"Test Offer\",\r\n \"description\": \"This is a test Offer\",\r\n \"state\": \"Private\",\r\n \"subscriptionCount\": 0,\r\n \"maxSubscriptionsPerAccount\": 100,\r\n \"basePlanIds\": [\r\n \"/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/resourceGroups/Plans/providers/Microsoft.Subscriptions.Admin/plans/testplan\"\r\n ],\r\n \"addonPlans\": []\r\n }\r\n}",
143+
"ResponseHeaders": {
144+
"Content-Length": [
145+
"559"
146+
],
147+
"Content-Type": [
148+
"application/json; charset=utf-8"
149+
],
150+
"Expires": [
151+
"-1"
152+
],
153+
"Cache-Control": [
154+
"no-cache"
155+
],
156+
"Date": [
157+
"Tue, 13 Mar 2018 18:52:52 GMT"
158+
],
159+
"Pragma": [
160+
"no-cache"
161+
],
162+
"x-ms-ratelimit-remaining-subscription-reads": [
163+
"14761"
164+
],
165+
"x-ms-request-id": [
166+
"31b87e01-3b7c-45ed-9ffb-19559e1ee79a"
167+
],
168+
"x-ms-correlation-request-id": [
169+
"31b87e01-3b7c-45ed-9ffb-19559e1ee79a"
170+
],
171+
"x-ms-routing-request-id": [
172+
"LOCAL:20180313T185253Z:31b87e01-3b7c-45ed-9ffb-19559e1ee79a"
173+
],
174+
"Strict-Transport-Security": [
175+
"max-age=31536000; includeSubDomains"
176+
],
177+
"X-Content-Type-Options": [
178+
"nosniff"
179+
]
180+
},
181+
"StatusCode": 200
182+
},
183+
{
184+
"RequestUri": "/subscriptions/8ab2551d-41e5-489b-9273-1cdf1cbc7dc6/resourcegroups/testrg/providers/Microsoft.Subscriptions.Admin/offers/testOffer1?api-version=2015-11-01",
185+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOGFiMjU1MWQtNDFlNS00ODliLTkyNzMtMWNkZjFjYmM3ZGM2L3Jlc291cmNlZ3JvdXBzL3Rlc3RyZy9wcm92aWRlcnMvTWljcm9zb2Z0LlN1YnNjcmlwdGlvbnMuQWRtaW4vb2ZmZXJzL3Rlc3RPZmZlcjE/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
186+
"RequestMethod": "DELETE",
187+
"RequestBody": "",
188+
"RequestHeaders": {
189+
"x-ms-client-request-id": [
190+
"8cca83a2-adcf-4d85-acfd-a66e4041d435"
191+
],
192+
"accept-language": [
193+
"en-US"
194+
],
195+
"User-Agent": [
196+
"FxVersion/4.6.26011.01",
197+
"Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient/0.1.0.0"
198+
]
199+
},
200+
"ResponseBody": "",
201+
"ResponseHeaders": {
202+
"Content-Length": [
203+
"0"
204+
],
205+
"Expires": [
206+
"-1"
207+
],
208+
"Cache-Control": [
209+
"no-cache"
210+
],
211+
"Date": [
212+
"Tue, 13 Mar 2018 18:52:52 GMT"
213+
],
214+
"Pragma": [
215+
"no-cache"
216+
],
217+
"x-ms-ratelimit-remaining-subscription-writes": [
218+
"1187"
219+
],
220+
"x-ms-request-id": [
221+
"259d10e0-e745-4923-8831-d20a1ed598e1"
222+
],
223+
"x-ms-correlation-request-id": [
224+
"259d10e0-e745-4923-8831-d20a1ed598e1"
225+
],
226+
"x-ms-routing-request-id": [
227+
"LOCAL:20180313T185253Z:259d10e0-e745-4923-8831-d20a1ed598e1"
228+
],
229+
"Strict-Transport-Security": [
230+
"max-age=31536000; includeSubDomains"
231+
],
232+
"X-Content-Type-Options": [
233+
"nosniff"
234+
]
235+
},
236+
"StatusCode": 200
237+
}
238+
],
239+
"Names": {},
240+
"Variables": {
241+
"SubscriptionId": "8ab2551d-41e5-489b-9273-1cdf1cbc7dc6"
242+
}
243+
}

0 commit comments

Comments
 (0)