Skip to content

Commit fa0234e

Browse files
New Powershell commands for Subscription RP (#12077)
* New Powershell commands * Update subscription * Adding new offer types * Adding session records * Fixes * Removing redundant parameters * Add md file * Update md files * Update md file and new record test case * Add online version * Update ChangeLog.md Co-authored-by: Yabo Hu <[email protected]>
1 parent ba9dfa7 commit fa0234e

File tree

14 files changed

+589
-2347
lines changed

14 files changed

+589
-2347
lines changed

src/Subscription/Subscription.Test/ScenarioTests/SubscriptionTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,19 @@ public void TestNewSubscription()
4141
{
4242
TestController.NewInstance.RunPowerShellTest(_logger, "Test-NewSubscription");
4343
}
44+
45+
[Fact]
46+
[Trait(Category.AcceptanceType, Category.CheckIn)]
47+
public void TestUpdateRenameSubscription()
48+
{
49+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-UpdateRenameSubscription");
50+
}
51+
52+
[Fact]
53+
[Trait(Category.AcceptanceType, Category.CheckIn)]
54+
public void TestUpdateCancelSubscription()
55+
{
56+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-UpdateCancelSubscription");
57+
}
4458
}
4559
}

src/Subscription/Subscription.Test/ScenarioTests/SubscriptionTests.ps1

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Create subscription
1919
function Test-NewSubscription
2020
{
2121
# $accounts = Get-AzEnrollmentAccount
22-
$accounts = @(@{ ObjectId = "cdf813b6-bdc2-4df5-b150-00ccfd7580e2" })
22+
$accounts = @(@{ ObjectId = "455fd0a7-b04e-4a92-9e1b-d0650c8ba276" })
2323

2424
# Verify the caller has at least one enrollment account.
2525
Assert-True { $accounts.Count -gt 0 }
@@ -31,3 +31,21 @@ function Test-NewSubscription
3131
Assert-AreEqual $myNewSubName $newSub.Name
3232
Assert-NotNull $newSub.SubscriptionId
3333
}
34+
35+
function Test-UpdateRenameSubscription
36+
{
37+
$subId = "21cba39d-cbbc-487f-9749-43c5c960f269"
38+
39+
$updateSub = Update-AzSubscription -SubscriptionId $subId -Action "Rename" -Name "RenameFromPowershell"
40+
41+
Assert-NotNull updateSub.SubscriptionId
42+
}
43+
44+
function Test-UpdateCancelSubscription
45+
{
46+
$subId = "21cba39d-cbbc-487f-9749-43c5c960f269"
47+
48+
$updateSub = Update-AzSubscription -SubscriptionId $subId -Action "Cancel"
49+
50+
Assert-NotNull updateSub.SubscriptionId
51+
}

0 commit comments

Comments
 (0)