File tree Expand file tree Collapse file tree 4 files changed +14
-26
lines changed Expand file tree Collapse file tree 4 files changed +14
-26
lines changed Original file line number Diff line number Diff line change @@ -36,16 +36,12 @@ Describe "Copy-DbaEndpoint" -Tag "UnitTests" {
36
36
37
37
Describe " Copy-DbaEndpoint" - Tag " IntegrationTests" {
38
38
BeforeAll {
39
- Get-DbaEndpoint - SqlInstance $TestConfig.instance2 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
40
- New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5022 - Owner sa
41
- Get-DbaEndpoint - SqlInstance $TestConfig.instance3 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
39
+ New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5022 - Owner sa - EnableException
42
40
}
43
41
44
42
AfterAll {
45
43
Get-DbaEndpoint - SqlInstance $TestConfig.instance2 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
46
- New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5022 - Owner sa
47
44
Get-DbaEndpoint - SqlInstance $TestConfig.instance3 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
48
- New-DbaEndpoint - SqlInstance $TestConfig.instance3 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5023 - Owner sa
49
45
}
50
46
51
47
Context " When copying endpoints between instances" {
Original file line number Diff line number Diff line change @@ -14,18 +14,11 @@ Describe "$CommandName Unit Tests" -Tags "UnitTests" {
14
14
}
15
15
16
16
Describe " $commandname Integration Tests" - Tag " IntegrationTests" {
17
- BeforeAll {
18
- $endpoint = Get-DbaEndpoint - SqlInstance $TestConfig.instance2 | Where-Object EndpointType -eq DatabaseMirroring
19
- $create = $endpoint | Export-DbaScript - Passthru
20
- Get-DbaEndpoint - SqlInstance $TestConfig.instance2 | Where-Object EndpointType -eq DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
21
- }
22
17
AfterAll {
23
- Get-DbaEndpoint - SqlInstance $TestConfig.instance2 | Where-Object EndpointType -eq DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
24
- if ($create ) {
25
- Invoke-DbaQuery - SqlInstance $TestConfig.instance2 - Query " $create "
26
- }
18
+ $null = Remove-DbaEndpoint - SqlInstance $TestConfig.instance2 , $TestConfig.instance3 - EndPoint dbatoolsci_MirroringEndpoint - Confirm:$false
27
19
}
28
- $results = New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Type DatabaseMirroring - Role Partner - Name Mirroring - Confirm:$false | Start-DbaEndpoint - Confirm:$false
20
+
21
+ $results = New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Type DatabaseMirroring - Role Partner - Name dbatoolsci_MirroringEndpoint - Confirm:$false | Start-DbaEndpoint - Confirm:$false
29
22
30
23
It " creates an endpoint of the db mirroring type" {
31
24
$results.EndpointType | Should - Be ' DatabaseMirroring'
Original file line number Diff line number Diff line change @@ -15,15 +15,7 @@ Describe "$CommandName Unit Tests" -Tags "UnitTests" {
15
15
16
16
Describe " $commandname Integration Tests" - Tag " IntegrationTests" {
17
17
BeforeAll {
18
- $endpoint = Get-DbaEndpoint - SqlInstance $TestConfig.instance2 | Where-Object EndpointType -eq DatabaseMirroring
19
- $create = $endpoint | Export-DbaScript - Passthru
20
- $null = $endpoint | Remove-DbaEndpoint - Confirm:$false
21
- $results = New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Type DatabaseMirroring - Role Partner - Name Mirroring - Confirm:$false | Start-DbaEndpoint - Confirm:$false
22
- }
23
- AfterAll {
24
- if ($create ) {
25
- Invoke-DbaQuery - SqlInstance $TestConfig.instance2 - Query " $create "
26
- }
18
+ $null = New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Type DatabaseMirroring - Role Partner - Name Mirroring - EnableException - Confirm:$false | Start-DbaEndpoint - EnableException - Confirm:$false
27
19
}
28
20
29
21
It " removes an endpoint" {
Original file line number Diff line number Diff line change @@ -14,8 +14,15 @@ Describe "$CommandName Unit Tests" -Tags "UnitTests" {
14
14
}
15
15
16
16
Describe " $commandname Integration Tests" - Tag " IntegrationTests" {
17
- It - Skip " returns success" {
18
- $results = Test-DbaEndpoint - SqlInstance $TestConfig.instance3
17
+ BeforeAll {
18
+ $null = New-DbaEndpoint - SqlInstance $TestConfig.instance2 - Type DatabaseMirroring - Name dbatoolsci_MirroringEndpoint - EnableException - Confirm:$false | Start-DbaEndpoint - EnableException
19
+ }
20
+ AfterAll {
21
+ $null = Remove-DbaEndpoint - SqlInstance $TestConfig.instance2 - EndPoint dbatoolsci_MirroringEndpoint - Confirm:$false
22
+ }
23
+
24
+ It " returns success" {
25
+ $results = Test-DbaEndpoint - SqlInstance $TestConfig.instance2
19
26
$results | Select-Object - First 1 - ExpandProperty Connection | Should - Be ' Success'
20
27
}
21
28
} # $TestConfig.instance2 for appveyor
You can’t perform that action at this time.
0 commit comments