Skip to content

Commit a1f40a5

Browse files
authored
Merge pull request #1174 from microsoft/Feature-21818-Update
Fix: Update the fail criteria logic in test 21818
2 parents 4453cec + 1c40f3a commit a1f40a5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/powershell/tests/Test-Assessment.21818.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ ORDER BY rd.displayName;
123123
$notificationRules += ($rule | Add-Member -MemberType NoteProperty -Name RoleDisplayName -Value $roleDisplayName -Force -PassThru)
124124

125125
# TO-DO: When the performance of the API is improved, we can collect all rules and move the check outside the loop to determine if the test passes or fails.
126-
# Check if isDefaultRecipientsEnabled is true and notificationRecipients is an empty array
127-
if ($rule.isDefaultRecipientsEnabled -eq $true -and
128-
$rule.notificationRecipients.Count -eq 0) {
126+
# Check if isDefaultRecipientsEnabled is false and notificationRecipients is an empty array
127+
if ($rule.isDefaultRecipientsEnabled -eq $false -and
128+
($null -eq $rule.notificationRecipients -or $rule.notificationRecipients.Count -eq 0)) {
129129
$passed = $false
130130
$exitLoop = $true
131131
break # Exit inner loop if condition is met

0 commit comments

Comments
 (0)