Skip to content

Commit 95e20c0

Browse files
committed
MarketplaceOrdering use swithparameter instead of bool and changes due to comments on PR
1 parent 89d187b commit 95e20c0

File tree

15 files changed

+332
-145
lines changed

15 files changed

+332
-145
lines changed

TestMappings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,8 @@
170170
],
171171
"src/ResourceManager/Profile/Commands.Profile.Test/": [
172172
".\\src\\ResourceManager\\Profile\\Commands.Profile.Test\\bin\\Debug\\Microsoft.Azure.Commands.Profile.Test.dll"
173+
],
174+
"src/ResourceManager/MarketplaceOrdering/Commands.MarketplaceOrdering.Test/": [
175+
".\\src\\ResourceManager\\MarketplaceOrdering\\Commands.MarketplaceOrdering.Test\\bin\\Debug\\Microsoft.Azure.Commands.MarketplaceOrdering.Test.dll"
173176
]
174177
}

setup/azurecmdfiles.wxi

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7106,12 +7106,6 @@
71067106
<Component Id="cmp0288996DAF3F5401E14AC034166AE89D" Guid="*">
71077107
<File Id="fil713A1AFA219BD6B114C9D652E014F08A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.MarketplaceOrdering\AzureRM.MarketplaceOrdering.psm1" />
71087108
</Component>
7109-
<Component Id="cmp4EED2737300C8F03A04CD370B2B1A16F" Guid="*">
7110-
<File Id="filADF2026C7DD45CA957C302F6E58D71A7" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.MarketplaceOrdering\AzureRM.Profile.psd1" />
7111-
</Component>
7112-
<Component Id="cmpFFF0E91695372C7062F9C01D91CB1769" Guid="*">
7113-
<File Id="filA3CCE88184489456EB58C50D5F46D509" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.MarketplaceOrdering\AzureRmProfileStartup.ps1" />
7114-
</Component>
71157109
<Component Id="cmp61A2F6BAE32D6B1610634661666B00EB" Guid="*">
71167110
<File Id="fil47AB96F186D0AB1AF53DBF6CE77DD0A6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.MarketplaceOrdering\Hyak.Common.dll" />
71177111
</Component>
@@ -7130,12 +7124,6 @@
71307124
<Component Id="cmpA935356DB49173BE632246C7D5831B87" Guid="*">
71317125
<File Id="fil543466169A8CDB4A63AFB0670B1A8974" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.MarketplaceOrdering\Microsoft.Azure.Commands.MarketplaceOrdering.Format.ps1xml" />
71327126
</Component>
7133-
<Component Id="cmpE84543C0175CAD4DD739E41582EBF234" Guid="*">
7134-
<File Id="filCBBECF78F45145A3E52A8709E5F24C9C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.MarketplaceOrdering\Microsoft.Azure.Commands.Profile.format.ps1xml" />
7135-
</Component>
7136-
<Component Id="cmpB446FBB46722C39D70BFC9E3433D8E0D" Guid="*">
7137-
<File Id="fil2E96B8126D3BA9F36677A32504A94CBC" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.MarketplaceOrdering\Microsoft.Azure.Commands.Profile.types.ps1xml" />
7138-
</Component>
71397127
<Component Id="cmp22F865481B4F65F5A7677100DDEBF80F" Guid="*">
71407128
<File Id="filEC1D7D16C113689C0A843237756CEE7F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.MarketplaceOrdering\Microsoft.Azure.Commands.ResourceManager.Common.dll" />
71417129
</Component>
@@ -11704,16 +11692,12 @@
1170411692
<ComponentRef Id="cmpAEE0BBCF0220365A089D7B8797E01190" />
1170511693
<ComponentRef Id="cmp7A8866964515C9266836AE2727FC2772" />
1170611694
<ComponentRef Id="cmp0288996DAF3F5401E14AC034166AE89D" />
11707-
<ComponentRef Id="cmp4EED2737300C8F03A04CD370B2B1A16F" />
11708-
<ComponentRef Id="cmpFFF0E91695372C7062F9C01D91CB1769" />
1170911695
<ComponentRef Id="cmp61A2F6BAE32D6B1610634661666B00EB" />
1171011696
<ComponentRef Id="cmp7B5D5FD680D26D30857427E36AAFA0DB" />
1171111697
<ComponentRef Id="cmpD25AAE4E5D284F4849212C1BB5C53D35" />
1171211698
<ComponentRef Id="cmp0207800F580CB08D274BA341FAB3497A" />
1171311699
<ComponentRef Id="cmpD7BAE7FE5CF6F216C224400B50C0476E" />
1171411700
<ComponentRef Id="cmpA935356DB49173BE632246C7D5831B87" />
11715-
<ComponentRef Id="cmpE84543C0175CAD4DD739E41582EBF234" />
11716-
<ComponentRef Id="cmpB446FBB46722C39D70BFC9E3433D8E0D" />
1171711701
<ComponentRef Id="cmp22F865481B4F65F5A7677100DDEBF80F" />
1171811702
<ComponentRef Id="cmp5119252ED0C2A2BE2FD9A40F7759876C" />
1171911703
<ComponentRef Id="cmpE19137AF99446153F264315346D5ACF9" />

src/ResourceManager/MarketplaceOrdering/Commands.MarketplaceOrdering.Test/Commands.MarketplaceOrdering.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
<None Include="SessionRecords\Microsoft.Azure.Commands.MarketplaceOrdering.Test.ScenarioTests.AgreementsTests\TestSetAgreementAccepted.json" />
154154
<None Include="SessionRecords\Microsoft.Azure.Commands.MarketplaceOrdering.Test.ScenarioTests.AgreementsTests\TestSetAgreementAcceptedPipeline.json" />
155155
<None Include="SessionRecords\Microsoft.Azure.Commands.MarketplaceOrdering.Test.ScenarioTests.AgreementsTests\TestSetAgreementNotAccepted.json" />
156+
<None Include="SessionRecords\Microsoft.Azure.Commands.MarketplaceOrdering.Test.ScenarioTests.AgreementsTests\TestSetAgreementRejectPipeline.json" />
156157
</ItemGroup>
157158
<ItemGroup>
158159
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />

src/ResourceManager/MarketplaceOrdering/Commands.MarketplaceOrdering.Test/ScenarioTests/AgreementsTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,12 @@ public void TestSetAgreementAcceptedPipeline()
5656
{
5757
TestController.NewInstance.RunPowerShellTest(_logger, "Test-SetAgreementTermsAcceptedPipelineGet");
5858
}
59+
60+
[Fact]
61+
[Trait(Category.AcceptanceType, Category.CheckIn)]
62+
public void TestSetAgreementRejectPipeline()
63+
{
64+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-SetAgreementTermsRejectedPipelineGet");
65+
}
5966
}
6067
}

src/ResourceManager/MarketplaceOrdering/Commands.MarketplaceOrdering.Test/ScenarioTests/AgreementsTests.ps1

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Test-GetAgreementTerms
3131

3232
<#
3333
.SYNOPSIS
34-
Set Agrement Terms - Accepted = false
34+
Set Agrement Terms - Reject
3535
#>
3636
function Test-SetAgreementTermsNotAccepted
3737
{
@@ -45,7 +45,7 @@ function Test-SetAgreementTermsNotAccepted
4545
Assert-NotNull $agreementTerms.PrivacyPolicyLink
4646
Assert-NotNull $agreementTerms.Signature
4747

48-
$newAgreementTerms = Set-AzureRmMarketplaceTerms -Publisher $PublisherId -Product $ProductId -Name $PlanId -Accepted $false
48+
$newAgreementTerms = Set-AzureRmMarketplaceTerms -Publisher $PublisherId -Product $ProductId -Name $PlanId -Reject
4949
Assert-NotNull $newAgreementTerms
5050
Assert-NotNull $newAgreementTerms.LicenseTextLink
5151
Assert-NotNull $newAgreementTerms.PrivacyPolicyLink
@@ -55,7 +55,7 @@ function Test-SetAgreementTermsNotAccepted
5555

5656
<#
5757
.SYNOPSIS
58-
Set Agrement Terms - Accepted = true
58+
Set Agrement Terms - Accept
5959
#>
6060
function Test-SetAgreementTermsAccepted
6161
{
@@ -69,7 +69,7 @@ function Test-SetAgreementTermsAccepted
6969
Assert-NotNull $agreementTerms.PrivacyPolicyLink
7070
Assert-NotNull $agreementTerms.Signature
7171

72-
$newAgreementTerms = Set-AzureRmMarketplaceTerms -Publisher $PublisherId -Product $ProductId -Name $PlanId -Terms $agreementTerms -Accepted $true
72+
$newAgreementTerms = Set-AzureRmMarketplaceTerms -Publisher $PublisherId -Product $ProductId -Name $PlanId -Terms $agreementTerms -Accept
7373
Assert-NotNull $newAgreementTerms
7474
Assert-NotNull $newAgreementTerms.LicenseTextLink
7575
Assert-NotNull $newAgreementTerms.PrivacyPolicyLink
@@ -79,17 +79,34 @@ function Test-SetAgreementTermsAccepted
7979

8080
<#
8181
.SYNOPSIS
82-
Set Agrement Terms - Accepted = true
82+
Set Agrement Terms pipeline - Accept
8383
#>
8484
function Test-SetAgreementTermsAcceptedPipelineGet
8585
{
8686
$PublisherId = "microsoft-ads"
8787
$ProductId = "windows-data-science-vm"
8888
$PlanId = "windows2016"
89-
$newAgreementTerms = Get-AzureRmMarketplaceTerms -Publisher $PublisherId -Product $ProductId -Name $PlanId|Set-AzureRmMarketplaceTerms -Accepted $true
89+
$newAgreementTerms = Get-AzureRmMarketplaceTerms -Publisher $PublisherId -Product $ProductId -Name $PlanId|Set-AzureRmMarketplaceTerms -Accept
9090
Assert-NotNull $newAgreementTerms
9191
Assert-NotNull $newAgreementTerms.LicenseTextLink
9292
Assert-NotNull $newAgreementTerms.PrivacyPolicyLink
9393
Assert-NotNull $newAgreementTerms.Signature
9494
Assert-AreEqual true $newAgreementTerms.Accepted
95+
}
96+
97+
<#
98+
.SYNOPSIS
99+
Set Agrement Terms pipeline - Reject
100+
#>
101+
function Test-SetAgreementTermsRejectedPipelineGet
102+
{
103+
$PublisherId = "microsoft-ads"
104+
$ProductId = "windows-data-science-vm"
105+
$PlanId = "windows2016"
106+
$newAgreementTerms = Get-AzureRmMarketplaceTerms -Publisher $PublisherId -Product $ProductId -Name $PlanId|Set-AzureRmMarketplaceTerms -Reject
107+
Assert-NotNull $newAgreementTerms
108+
Assert-NotNull $newAgreementTerms.LicenseTextLink
109+
Assert-NotNull $newAgreementTerms.PrivacyPolicyLink
110+
Assert-NotNull $newAgreementTerms.Signature
111+
Assert-AreEqual false $newAgreementTerms.Accepted
95112
}

src/ResourceManager/MarketplaceOrdering/Commands.MarketplaceOrdering.Test/SessionRecords/Microsoft.Azure.Commands.MarketplaceOrdering.Test.ScenarioTests.AgreementsTests/TestGetAgreement.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
"RequestBody": "",
88
"RequestHeaders": {
99
"x-ms-client-request-id": [
10-
"7bbc24c5-cc79-4721-a912-d955a92c7a09"
10+
"183b4a29-14b2-455e-8818-85486c4b3439"
1111
],
1212
"accept-language": [
1313
"en-US"
1414
],
1515
"User-Agent": [
1616
"FxVersion/4.7.2110.0",
17-
"OSName/Windows_10_Enterprise",
17+
"OSName/Windows10Enterprise",
1818
"OSVersion/6.3.15063",
19-
"Microsoft.Azure.Management.MarketplaceOrdering.MarketplaceOrderingAgreementsClient/1.0.0"
19+
"Microsoft.Azure.Management.MarketplaceOrdering.MarketplaceOrderingAgreementsClient/1.0.0.0"
2020
]
2121
},
22-
"ResponseBody": "{\r\n \"id\": \"/subscriptions/2ad668e2-04e4-4a99-8292-4df4f74362ae/providers/Microsoft.MarketplaceOrdering/offertypes/microsoft-ads/offers/windows-data-science-vm/plans/windows2016\",\r\n \"name\": \"windows2016\",\r\n \"type\": \"Microsoft.MarketplaceOrdering/offertypes\",\r\n \"properties\": {\r\n \"publisher\": \"microsoft-ads\",\r\n \"product\": \"windows-data-science-vm\",\r\n \"plan\": \"windows2016\",\r\n \"licenseTextLink\": \"https://106c4.wpc.azureedge.net/80106C4/Gallery-Prod/cdn/2015-02-24/prod20161101-microsoft-windowsazure-gallery/microsoft-ads.windows-data-science-vmwindows2016.1.0.3/Content/LegalTerms0.DEFAULT.txt\",\r\n \"privacyPolicyLink\": \"https://www.microsoft.com/EN-US/privacystatement/OnlineServices/Default.aspx\",\r\n \"retrieveDatetime\": \"2017-10-04T04:13:57.2894451Z\",\r\n \"signature\": \"J2EMGMJKVJWNLRDHDZLXIQ3Y5FAQ6PW7N7M4MI5QJVBH5BCWPSZCMD3A3TW6CSEQAAUNRJB5QR7DYP6ER5S57WGPXTQVOBMZFQ2RCJA\",\r\n \"accepted\": true\r\n }\r\n}",
22+
"ResponseBody": "{\r\n \"id\": \"/subscriptions/2ad668e2-04e4-4a99-8292-4df4f74362ae/providers/Microsoft.MarketplaceOrdering/offertypes/microsoft-ads/offers/windows-data-science-vm/plans/windows2016\",\r\n \"name\": \"windows2016\",\r\n \"type\": \"Microsoft.MarketplaceOrdering/offertypes\",\r\n \"properties\": {\r\n \"publisher\": \"microsoft-ads\",\r\n \"product\": \"windows-data-science-vm\",\r\n \"plan\": \"windows2016\",\r\n \"licenseTextLink\": \"https://106c4.wpc.azureedge.net/80106C4/Gallery-Prod/cdn/2015-02-24/prod20161101-microsoft-windowsazure-gallery/microsoft-ads.windows-data-science-vmwindows2016.1.0.3/Content/LegalTerms0.DEFAULT.txt\",\r\n \"privacyPolicyLink\": \"https://www.microsoft.com/EN-US/privacystatement/OnlineServices/Default.aspx\",\r\n \"retrieveDatetime\": \"2017-10-05T00:44:59.4730605Z\",\r\n \"signature\": \"7AJJ66ILJKF54PJAXYKEMCRFQWQYHOA5CFPIVNIB3QJGRWNGZDNIPE2ZGXWTDTVIJZWXTCLTLDBJXVXUXASLST2GXB74XQ2B56UPJEI\",\r\n \"accepted\": true\r\n }\r\n}",
2323
"ResponseHeaders": {
2424
"Content-Length": [
2525
"847"
@@ -37,13 +37,13 @@
3737
"Accept-Encoding"
3838
],
3939
"x-ms-ratelimit-remaining-subscription-reads": [
40-
"14999"
40+
"14998"
4141
],
4242
"x-ms-client-request-id": [
43-
"7bbc24c5-cc79-4721-a912-d955a92c7a09"
43+
"183b4a29-14b2-455e-8818-85486c4b3439"
4444
],
4545
"x-ms-request-id": [
46-
"7dbc39f3-e914-4153-8ddb-1353981482f7"
46+
"b5bd7a10-8d20-4792-a72a-db8db89e1ff1"
4747
],
4848
"DataServiceVersion": [
4949
"5.2.1.309 (AzureUX-Store:master.9dbea9b4.170911-1246)"
@@ -52,16 +52,16 @@
5252
"max-age=31536000; includeSubDomains"
5353
],
5454
"x-ms-correlation-request-id": [
55-
"44904573-d45e-4dda-9410-a4441930a0de"
55+
"9ba5f8dd-9ad2-44cc-8bf0-9957569882ae"
5656
],
5757
"x-ms-routing-request-id": [
58-
"WESTUS:20171004T041357Z:44904573-d45e-4dda-9410-a4441930a0de"
58+
"WESTUS2:20171005T004459Z:9ba5f8dd-9ad2-44cc-8bf0-9957569882ae"
5959
],
6060
"Cache-Control": [
6161
"no-cache"
6262
],
6363
"Date": [
64-
"Wed, 04 Oct 2017 04:13:57 GMT"
64+
"Thu, 05 Oct 2017 00:44:58 GMT"
6565
],
6666
"Server": [
6767
"Microsoft-IIS/8.5"

0 commit comments

Comments
 (0)