Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 21, 2024
1 parent 1064bbf commit 9bebdac
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions tests/Connect-DbaInstance.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
# This might fail if a parallel test uses DAC - how can we ensure that this is the only test that is run?
It "opens and closes the connections" {
$server = Connect-DbaInstance -SqlInstance $TestConfig.instance1, $TestConfig.instance2 -DedicatedAdminConnection
$server[0].Name | Should -Be "ADMIN:$TestConfig.instance1"
$server[1].Name | Should -Be "ADMIN:$TestConfig.instance2"
$server[0].Name | Should -Be "ADMIN:$($TestConfig.instance1)"
$server[1].Name | Should -Be "ADMIN:$($TestConfig.instance2)"
$null = $server | Disconnect-DbaInstance
# DAC is not reopened in the background
Start-Sleep -Seconds 10
Expand Down
18 changes: 9 additions & 9 deletions tests/Copy-DbaDbMail.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
}
}

Context "Copy DbMail to $TestConfig.instance3" {
Context "Copy DbMail to $($TestConfig.instance3)" {
$results = Copy-DbaDbMail -Source $TestConfig.instance2 -Destination $TestConfig.instance3

It "Should have copied database mailitems" {
$results | Should Not Be $null
}
foreach ($r in $results) {
if ($r.type -in @('Mail Configuration', 'Mail Account', 'Mail Profile')) {
It "Should have copied $($r.type) from $TestConfig.instance2" {
$r.SourceServer | Should Be "$TestConfig.instance2"
It "Should have copied $($r.type) from $($TestConfig.instance2)" {
$r.SourceServer | Should Be "$($TestConfig.instance2)"
}
It "Should have copied $($r.type) to $TestConfig.instance3" {
$r.DestinationServer | Should Be "$TestConfig.instance3"
It "Should have copied $($r.type) to $($TestConfig.instance3)" {
$r.DestinationServer | Should Be "$($TestConfig.instance3)"
}
}
}
Expand All @@ -93,12 +93,12 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
}

foreach ($r in $results) {
It "Should have $($r.status) $($r.type) from $TestConfig.instance2" {
$r.SourceServer | Should Be "$TestConfig.instance2"
It "Should have $($r.status) $($r.type) from $($TestConfig.instance2)" {
$r.SourceServer | Should Be "$($TestConfig.instance2)"
$r.status | Should Be 'Skipped'
}
It "Should have $($r.status) $($r.type) to $TestConfig.instance3" {
$r.DestinationServer | Should Be "$TestConfig.instance3"
It "Should have $($r.status) $($r.type) to $($TestConfig.instance3)" {
$r.DestinationServer | Should Be "$($TestConfig.instance3)"
$r.status | Should Be 'Skipped'
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaDatabase.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
}

$results = Find-DbaDatabase -SqlInstance $TestConfig.instance1, $TestConfig.instance2 -Pattern Master
It "Should return true if Executed Against 2 instances: $TestConfig.instance1 and $TestConfig.instance2" {
It "Should return true if Executed Against 2 instances: $TestConfig.instance1 and $($TestConfig.instance2)" {
($results.InstanceName | Select-Object -Unique).count -eq 2 | Should Be $true
}
$results = Find-DbaDatabase -SqlInstance $TestConfig.instance2 -Property ServiceBrokerGuid -Pattern -0000-0000-000000000000
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaDbUnusedIndex.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
Context "Verify basics of the Find-DbaDbUnusedIndex command" {
BeforeAll {
Write-Message -Level Warning -Message "Find-DbaDbUnusedIndex testing connection to $TestConfig.instance2"
Write-Message -Level Warning -Message "Find-DbaDbUnusedIndex testing connection to $($TestConfig.instance2)"
Test-DbaConnection -SqlInstance $TestConfig.instance2

$server = Connect-DbaInstance -SqlInstance $TestConfig.instance2
Expand Down
14 changes: 7 additions & 7 deletions tests/Get-DbaLinkedServer.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
}

Context "Gets Linked Servers" {
$results = Get-DbaLinkedServer -SqlInstance $TestConfig.instance2 | Where-Object {$_.name -eq "$TestConfig.instance3"}
$results = Get-DbaLinkedServer -SqlInstance $TestConfig.instance2 | Where-Object {$_.name -eq "$($TestConfig.instance3)"}
It "Gets results" {
$results | Should Not Be $null
}
It "Should have Remote Server of $TestConfig.instance3" {
$results.RemoteServer | Should Be "$TestConfig.instance3"
It "Should have Remote Server of $($TestConfig.instance3)" {
$results.RemoteServer | Should Be "$($TestConfig.instance3)"
}
It "Should have a product name of SQL Server" {
$results.productname | Should Be 'SQL Server'
Expand All @@ -40,12 +40,12 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
}
}
Context "Gets Linked Servers using -LinkedServer" {
$results = Get-DbaLinkedServer -SqlInstance $TestConfig.instance2 -LinkedServer "$TestConfig.instance3"
$results = Get-DbaLinkedServer -SqlInstance $TestConfig.instance2 -LinkedServer "$($TestConfig.instance3)"
It "Gets results" {
$results | Should Not Be $null
}
It "Should have Remote Server of $TestConfig.instance3" {
$results.RemoteServer | Should Be "$TestConfig.instance3"
It "Should have Remote Server of $($TestConfig.instance3)" {
$results.RemoteServer | Should Be "$($TestConfig.instance3)"
}
It "Should have a product name of SQL Server" {
$results.productname | Should Be 'SQL Server'
Expand All @@ -55,7 +55,7 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
}
}
Context "Gets Linked Servers using -ExcludeLinkedServer" {
$results = Get-DbaLinkedServer -SqlInstance $TestConfig.instance2 -ExcludeLinkedServer "$TestConfig.instance3"
$results = Get-DbaLinkedServer -SqlInstance $TestConfig.instance2 -ExcludeLinkedServer "$($TestConfig.instance3)"
It "Gets results" {
$results | Should Be $null
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Remove-DbaDbFileGroup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {

It "Tries to remove a non-existent filegroup" {
Remove-DbaDbFileGroup -SqlInstance $TestConfig.instance2 -Database $db1name -FileGroup invalidFileGroupName -Confirm:$false -WarningVariable warnings
$warnings | Should -BeLike "*Filegroup invalidFileGroupName does not exist in the database $db1name on $TestConfig.instance2"
$warnings | Should -BeLike "*Filegroup invalidFileGroupName does not exist in the database $db1name on $($TestConfig.instance2)"
}

It "Tries to remove a filegroup that still has files" {
Remove-DbaDbFileGroup -SqlInstance $TestConfig.instance2 -Database $db1name -FileGroup $fileGroup2Name -Confirm:$false -WarningVariable warnings
$warnings | Should -BeLike "*Filegroup $fileGroup2Name is not empty. Before the filegroup can be dropped the files must be removed in $fileGroup2Name on $db1name on $TestConfig.instance2"
$warnings | Should -BeLike "*Filegroup $fileGroup2Name is not empty. Before the filegroup can be dropped the files must be removed in $fileGroup2Name on $db1name on $($TestConfig.instance2)"
}

It "Removes a filegroup using a database from a pipeline and a filegroup from a pipeline" {
Expand Down
2 changes: 1 addition & 1 deletion tests/Test-DbaTempDbConfig.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
}

Describe "$CommandName Integration Tests" -Tag "IntegrationTests" {
Context "Command actually works on $TestConfig.instance2" {
Context "Command actually works on $($TestConfig.instance2)" {
$server = Connect-DbaInstance -SqlInstance $TestConfig.instance2
$results = Test-DbaTempdbConfig -SqlInstance $server
It "Should have correct properties" {
Expand Down

0 comments on commit 9bebdac

Please sign in to comment.