@@ -20,22 +20,21 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
20
20
21
21
Describe " $commandname Integration Tests" - Tag " IntegrationTests" {
22
22
BeforeAll {
23
- $endpoint = Get-DbaEndpoint - SqlInstance $script :instance2 | Where-Object EndpointType -eq DatabaseMirroring
24
- $create = $endpoint | Export-DbaScript - Passthru
25
- $null = $endpoint | Remove-DbaEndpoint - Confirm:$false
26
- $results = New-DbaEndpoint - SqlInstance $script :instance2 - Type DatabaseMirroring - Role Partner - Name Mirroring - Confirm:$false
23
+ Get-DbaEndpoint - SqlInstance $script :instance2 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
24
+ New-DbaEndpoint - SqlInstance $script :instance2 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5022 - Owner sa
25
+ Get-DbaEndpoint - SqlInstance $script :instance3 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm:$false
27
26
}
28
27
AfterAll {
29
- if ( $create ) {
30
- $null = Get -DbaEndpoint - SqlInstance $script :instance2 , $ script :instance3 | Where-Object EndpointType -eq DatabaseMirroring | Remove-DbaEndpoint - Confirm: $false
31
- Invoke-DbaQuery - SqlInstance $script :instance2 - Query " $create "
32
- }
28
+ Get-DbaEndpoint - SqlInstance $ script :instance2 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm: $false
29
+ New -DbaEndpoint - SqlInstance $script :instance2 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5022 - Owner sa
30
+ Get-DbaEndpoint - SqlInstance $script :instance3 - Type DatabaseMirroring | Remove-DbaEndpoint - Confirm: $false
31
+ New-DbaEndpoint - SqlInstance $ script :instance3 - Name dbatoolsci_MirroringEndpoint - Type DatabaseMirroring - Port 5023 - Owner sa
33
32
}
34
33
35
34
It " copies an endpoint" {
36
- $results = Copy-DbaEndpoint - Source $script :instance2 - Destination $script :instance3 - Endpoint Mirroring
35
+ $results = Copy-DbaEndpoint - Source $script :instance2 - Destination $script :instance3 - Endpoint dbatoolsci_MirroringEndpoint
37
36
$results.DestinationServer | Should - Be $script :instance3
38
37
$results.Status | Should - Be ' Successful'
39
- $results.Name | Should - Be ' Mirroring '
38
+ $results.Name | Should - Be ' dbatoolsci_MirroringEndpoint '
40
39
}
41
40
}
0 commit comments