Skip to content

Commit

Permalink
Add custom pester test
Browse files Browse the repository at this point in the history
  • Loading branch information
oZakari committed Feb 12, 2025
1 parent 7dbdf9a commit 5679831
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions avm/ptn/mgmt-groups/subscription-placement/pester/main.tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
param (
[Parameter(Mandatory = $false)]
[hashtable] $TestInputData = @{}
)

Describe 'Bicep Landing Zone (Sub) Vending Tests' {

BeforeAll {
$subscriptionId = $TestInputData.DeploymentOutputs.createdSubId.Value
Update-AzConfig -DisplayBreakingChangeWarning $false
Select-AzSubscription -subscriptionId $subscriptionId
}

Context 'Subscription Placement Tests' {
BeforeAll {
$subscriptionPlacementSummary = $TestInputData.DeploymentOutputs.subscriptionPlacementSummary.Value
}

It 'Should have a Subscription Placement Summary' {
$subscriptionPlacementSummary | Should -Not -BeNullOrEmpty
}

It 'Should contain the correct management group ID' {
$subscriptionPlacementSummary | Should -Contain 'test-mgmt-group'
}

It 'Should contain the correct subscription ID' {
$subscriptionPlacementSummary | Should -Contain $subscriptionId
}
}
}

0 comments on commit 5679831

Please sign in to comment.