@@ -15,23 +15,17 @@ Describe "$commandname Unit Tests" -Tag "UnitTests" {
15
15
16
16
Describe " $commandname Integration Tests" - Tag " IntegrationTests" {
17
17
BeforeAll {
18
- $null = Get-DbaProcess - SqlInstance $TestConfig.instance2 | Where-Object Program -Match dbatools | Stop-DbaProcess - Confirm:$false - WarningAction SilentlyContinue
19
18
$server = Connect-DbaInstance - SqlInstance $TestConfig.instance2
20
19
$db1 = " dbatoolsci_mirroring"
21
20
22
- Remove-DbaDbMirror - SqlInstance $TestConfig.instance2 - Database $db1 - Confirm:$false
23
- Remove-DbaDatabase - SqlInstance $TestConfig.instance2 - Database $db1 - Confirm:$false
24
- $null = Get-DbaDatabase - SqlInstance $TestConfig.instance2 - Database $db1 | Remove-DbaDatabase - Confirm:$false
25
- $null = $server.Query (" CREATE DATABASE $db1 " )
26
-
27
- Get-DbaEndpoint - SqlInstance $TestConfig.instance2 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
28
- New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5022 - Owner sa
29
- Get-DbaEndpoint - SqlInstance $TestConfig.instance3 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
30
- New-DbaEndpoint - SqlInstance $TestConfig.instance3 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5023 - Owner sa
21
+ $null = New-DbaDatabase - SqlInstance $TestConfig.instance2 - Name $db1 - EnableException
22
+ $null = New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5022 - Owner sa - EnableException
23
+ $null = New-DbaEndpoint - SqlInstance $TestConfig.instance3 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5023 - Owner sa - EnableException
31
24
}
32
25
AfterAll {
33
26
$null = Remove-DbaDbMirror - SqlInstance $TestConfig.instance2 , $TestConfig.instance3 - Database $db1 - Confirm:$false
34
- $null = Remove-DbaDatabase - Confirm:$false - SqlInstance $TestConfig.instance2 , $TestConfig.instance3 - Database $db1 - ErrorAction SilentlyContinue
27
+ $null = Remove-DbaDatabase - SqlInstance $TestConfig.instance2 , $TestConfig.instance3 - Database $db1 - Confirm:$false
28
+ $null = Remove-DbaEndpoint - SqlInstance $TestConfig.instance2 , $TestConfig.instance3 - EndPoint dbatoolsci_MirroringEndpoint - Confirm:$false
35
29
}
36
30
37
31
It " returns success" {
0 commit comments