Skip to content

Commit

Permalink
fix pester test
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOnlyWei committed Mar 18, 2021
1 parent 4c05026 commit 7e4c9b2
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 77 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,8 @@ Describe "Alerts" -Tags @('Alert', 'InfrastructureInsightsAdmin') {
# Test repair for a non-existing alert
Write-Verbose "Repairing alert with an invalid name"

Repair-AzsAlert -Name "wrongid" -ErrorVariable invalidAlertErr -ErrorAction SilentlyContinue

if(($invalidAlertErr.Count -ne 0) -and ($invalidAlertErr[0].ErrorDetails.Message.contains("Failed to remediate alert")))
{
Write-Verbose "As expected the repair operation failed"
}else
{
throw $invalidAlertErr
}

{ Repair-AzsAlert -Name "wrongid" -ErrorAction Stop } | Should Throw "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."
$Alerts = Get-AzsAlert

$Alerts | Should Not Be $null

foreach ($Alert in $Alerts)
Expand Down

0 comments on commit 7e4c9b2

Please sign in to comment.