@@ -448,26 +448,25 @@ Describe "$CommandName Integration Tests" -Tag "IntegrationTests" {
448
448
}
449
449
$files = @ ()
450
450
$files += Get-ChildItem $script :appveyorlabrepo \sql2008- backups\db1\FULL\
451
- $files += Get-ChildItem $script :appveyorlabrepo \sql2008- backups\db2 \FULL\
451
+ $files += Get-ChildItem $script :appveyorlabrepo \sql2008- backups\dbareports \FULL
452
452
$Results = $files | Restore-DbaDatabase - SqlInstance $script :instance1 - NoRecovery
453
453
It " Should Have restored the database cleanly" {
454
454
($results.RestoreComplete -contains $false ) | Should be $False
455
455
(($results | Measure-Object ).count -gt 0 ) | Should be $True
456
456
}
457
457
It " Should have left the db in a norecovery state" {
458
- 1 .. 2 | ForEach-Object {
459
- (Get-DbaDatabase - SqlInstance $script :instance1 - Database " db$_ " ).Status | Should Be " Restoring"
460
- }
458
+ (Get-DbaDatabase - SqlInstance $script :instance1 | Where-Object {$_.Status -eq ' Recovering' }).count | Should Be 0
461
459
}
462
- $Results2 = gci C:\github\appveyor- lab\sql2008- backups\db[12 ]\* - Recurse | ? {$_.PsIsContainer -eq $false } | Restore-DbaDatabase - SqlInstance $script :instance1 - Continue
460
+ $files = @ ()
461
+ $files += Get-ChildItem $script :appveyorlabrepo \sql2008- backups\db1\ - Recurse
462
+ $files += Get-ChildItem $script :appveyorlabrepo \sql2008- backups\dbareports\ - Recurse
463
+ $Results2 = $files | ? {$_.PsIsContainer -eq $false } | Restore-DbaDatabase - SqlInstance $script :instance1 - Continue
463
464
It " Should Have restored the database cleanly" {
464
465
($results2.RestoreComplete -contains $false ) | Should be $False
465
466
(($results2 | Measure-Object ).count -gt 0 ) | Should be $True
466
467
}
467
468
It " Should have recovered the database" {
468
- 1 .. 2 | ForEach-Object {
469
- (Get-DbaDatabase - SqlInstance $script :instance1 - Database " db$_ " ).Status | Should Be " Normal"
470
- }
469
+ (Get-DbaDatabase - SqlInstance $script :instance1 | Where-Object {$_.Status -eq ' Recovering' }).count | Should Be 0
471
470
}
472
471
}
473
472
0 commit comments