Skip to content

Commit 5f8e04b

Browse files
committed
Update Restore-SqlDscDatabase tests to assert database status using bitwise comparison for standby mode
1 parent 8041810 commit 5f8e04b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

tests/Integration/Commands/Restore-SqlDscDatabase.Integration.Tests.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,7 @@ Describe 'Restore-SqlDscDatabase' -Tag @('Integration_SQL2017', 'Integration_SQL
619619
$restoredDb.Refresh()
620620

621621
# Database should be online and in standby/read-only state
622-
$restoredDb.Status | Should -Contain 'Normal' -Because 'Database should be online in standby mode'
623-
$restoredDb.Status | Should -Contain 'Standby' -Because 'Database should be in standby mode'
622+
$restoredDb.Status | Should -Be ([Microsoft.SqlServer.Management.Smo.DatabaseStatus]::Normal -bor [Microsoft.SqlServer.Management.Smo.DatabaseStatus]::Standby) -Because 'Database should be online in standby mode'
624623
$restoredDb.IsReadOnly | Should -BeTrue -Because 'Database should be read-only in standby mode'
625624

626625
# Verify standby file exists and has content

0 commit comments

Comments
 (0)