@@ -353,32 +353,32 @@ foreach ($clustervm in $clusters) {
353
353
Context " Database availability group status for $ ( $AG.Name ) on $clustername " {
354
354
@ ($ag.AvailabilityReplicas.Where { $_.AvailabilityMode -eq ' SynchronousCommit' }).ForEach {
355
355
@ (Get-DbaAgDatabase - SqlInstance $psitem.Name - AvailabilityGroup $Ag.Name ).ForEach {
356
- It " Database $ ( $psitem.DatabaseName ) should be synchronised on the replica $ ( $psitem.Replica ) " {
356
+ It " Database $ ( $psitem.Name ) should be synchronised on the replica $ ( $psitem.sqlInstance ) " {
357
357
$psitem.SynchronizationState | Should - Be ' Synchronized' - Because ' The database on the synchronous replica should be synchronised'
358
358
}
359
- It " Database $ ( $psitem.DatabaseName ) should be failover ready on the replica $ ( $psitem.Replica ) " {
359
+ It " Database $ ( $psitem.Name ) should be failover ready on the replica $ ( $psitem.sqlInstance ) " {
360
360
$psitem.IsFailoverReady | Should - BeTrue - Because ' The database on the synchronous replica should be ready to failover'
361
361
}
362
- It " Database $ ( $psitem.DatabaseName ) should be joined on the replica $ ( $psitem.Replica ) " {
362
+ It " Database $ ( $psitem.Name ) should be joined on the replica $ ( $psitem.sqlInstance ) " {
363
363
$psitem.IsJoined | Should - BeTrue - Because ' The database on the synchronous replica should be joined to the availability group'
364
364
}
365
- It " Database $ ( $psitem.DatabaseName ) should not be suspended on the replica $ ( $psitem.Replica ) " {
365
+ It " Database $ ( $psitem.Name ) should not be suspended on the replica $ ( $psitem.sqlInstance ) " {
366
366
$psitem.IsSuspended | Should - Be $False - Because ' The database on the synchronous replica should not be suspended'
367
367
}
368
368
}
369
369
}
370
370
@ ($ag.AvailabilityReplicas.Where { $_.AvailabilityMode -eq ' AsynchronousCommit' }).ForEach {
371
371
@ (Get-DbaAgDatabase - SqlInstance $PSItem.Name - AvailabilityGroup $Ag.Name ).ForEach {
372
- It " Database $ ( $psitem.DatabaseName ) should be synchronising as it is Async on the secondary replica $ ( $psitem.Replica ) " {
372
+ It " Database $ ( $psitem.Name ) should be synchronising as it is Async on the secondary replica $ ( $psitem.sqlInstance ) " {
373
373
$psitem.SynchronizationState | Should - Be ' Synchronizing' - Because ' The database on the asynchronous secondary replica should be synchronising'
374
374
}
375
- It " Database $ ( $psitem.DatabaseName ) should not be failover ready on the secondary replica $ ( $psitem.Replica ) " {
375
+ It " Database $ ( $psitem.Name ) should not be failover ready on the secondary replica $ ( $psitem.sqlInstance ) " {
376
376
$psitem.IsFailoverReady | Should - BeFalse - Because ' The database on the asynchronous secondary replica should be ready to failover'
377
377
}
378
- It " Database $ ( $psitem.DatabaseName ) should be joined on the secondary replica $ ( $psitem.Replica ) " {
378
+ It " Database $ ( $psitem.Name ) should be joined on the secondary replica $ ( $psitem.sqlInstance ) " {
379
379
$psitem.IsJoined | Should - BeTrue - Because ' The database on the asynchronous secondary replica should be joined to the availability group'
380
380
}
381
- It " Database $ ( $psitem.DatabaseName ) should not be suspended on the secondary replica $ ( $psitem.Replica ) " {
381
+ It " Database $ ( $psitem.Name ) should not be suspended on the secondary replica $ ( $psitem.sqlInstance ) " {
382
382
$psitem.IsSuspended | Should - Be $False - Because ' The database on the asynchronous secondary replica should not be suspended'
383
383
}
384
384
}
0 commit comments