Skip to content

Commit

Permalink
maybe this'll do it
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 21, 2024
1 parent 383cb89 commit 44a66f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions tests/Measure-DbaDiskSpaceRequirement.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {

Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
Context "Should Measure Disk Space Required " {
$server1 = Connect-DbaInstance -SqlInstance $TestConfig.instance1
$server2 = Connect-DbaInstance -SqlInstance $TestConfig.instance2
$server1 = Connect-DbaInstance -SqlInstance $global:TestConfig.instance1
$server2 = Connect-DbaInstance -SqlInstance $global:TestConfig.instance2
$Options = @{
Source = $TestConfig.instance1
Destination = $TestConfig.instance2
Source = $global:TestConfig.instance1
Destination = $global:TestConfig.instance2
Database = "master"
DestinationDatabase = "Dbatoolsci_DestinationDB"
}
Expand Down
12 changes: 6 additions & 6 deletions tests/Remove-DbaLinkedServer.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
BeforeAll {
$random = Get-Random
$instance2 = Connect-DbaInstance -SqlInstance $TestConfig.instance2
$instance3 = Connect-DbaInstance -SqlInstance $TestConfig.instance3
$instance2 = Connect-DbaInstance -SqlInstance $global:TestConfig.instance2
$instance3 = Connect-DbaInstance -SqlInstance $global:TestConfig.instance3

$linkedServerName1 = "dbatoolscli_LS1_$random"
$linkedServerName2 = "dbatoolscli_LS2_$random"
Expand Down Expand Up @@ -61,26 +61,26 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
It "Removes a linked server" {
$results = Get-DbaLinkedServer -SqlInstance $instance2 -LinkedServer $linkedServerName1
$results.Length | Should -Be 1
Remove-DbaLinkedServer -SqlInstance $TestConfig.instance2 -LinkedServer $linkedServerName1 -Confirm:$false
Remove-DbaLinkedServer -SqlInstance $global:TestConfig.instance2 -LinkedServer $linkedServerName1 -Confirm:$false
$results = Get-DbaLinkedServer -SqlInstance $instance2 -LinkedServer $linkedServerName1
$results | Should -BeNullOrEmpty
}

It "Tries to remove a non-existent linked server" {
Remove-DbaLinkedServer -SqlInstance $TestConfig.instance2 -LinkedServer $linkedServerName1 -Confirm:$false -WarningVariable warnings
Remove-DbaLinkedServer -SqlInstance $global:TestConfig.instance2 -LinkedServer $linkedServerName1 -Confirm:$false -WarningVariable warnings
$warnings | Should -BeLike "*Linked server $linkedServerName1 does not exist on $($instance2.Name)"
}

It "Removes a linked server passed in via pipeline" {
$results = Get-DbaLinkedServer -SqlInstance $TestConfig.instance2 -LinkedServer $linkedServerName2
$results = Get-DbaLinkedServer -SqlInstance $global:TestConfig.instance2 -LinkedServer $linkedServerName2
$results.Length | Should -Be 1
Get-DbaLinkedServer -SqlInstance $instance2 -LinkedServer $linkedServerName2 | Remove-DbaLinkedServer -Confirm:$false
$results = Get-DbaLinkedServer -SqlInstance $instance2 -LinkedServer $linkedServerName2
$results | Should -BeNullOrEmpty
}

It "Removes a linked server using a server passed in via pipeline" {
$results = Get-DbaLinkedServer -SqlInstance $TestConfig.instance2 -LinkedServer $linkedServerName3
$results = Get-DbaLinkedServer -SqlInstance $global:TestConfig.instance2 -LinkedServer $linkedServerName3
$results.Length | Should -Be 1
$instance2 | Remove-DbaLinkedServer -LinkedServer $linkedServerName3 -Confirm:$false
$results = Get-DbaLinkedServer -SqlInstance $instance2 -LinkedServer $linkedServerName3
Expand Down

0 comments on commit 44a66f4

Please sign in to comment.