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 c9ec6fa commit c19b63a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions tests/Copy-DbaDbMail.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
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)"
$r.SourceServer | Should Be $TestConfig.instance2
}
It "Should have copied $($r.type) to $($TestConfig.instance3)" {
$r.DestinationServer | Should Be "$($TestConfig.instance3)"
$r.DestinationServer | Should Be $TestConfig.instance3
}
}
}
Expand All @@ -94,11 +94,11 @@ 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)"
$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)"
$r.DestinationServer | Should Be $TestConfig.instance3
$r.status | Should Be 'Skipped'
}
}
Expand Down
12 changes: 6 additions & 6 deletions tests/Get-DbaLinkedServer.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
BeforeAll {
$server = Connect-DbaInstance -SqlInstance $TestConfig.instance2
$null = $server.Query("EXEC master.dbo.sp_addlinkedserver
@server = N'$TestConfig.instance3',
@server = N'$($TestConfig.instance3)',
@srvproduct=N'SQL Server' ;")
}
AfterAll {
$null = $server.Query("EXEC master.dbo.sp_dropserver '$TestConfig.instance3', 'droplogins'; ")
$null = $server.Query("EXEC master.dbo.sp_dropserver '$($TestConfig.instance3)', 'droplogins'; ")
}

Context "Gets Linked Servers" {
Expand All @@ -30,7 +30,7 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
$results | Should Not Be $null
}
It "Should have Remote Server of $($TestConfig.instance3)" {
$results.RemoteServer | Should Be "$($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)"
$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
8 changes: 4 additions & 4 deletions tests/Start-DbaPfDataCollectorSet.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {

Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
BeforeAll {
$TestConfig.set = Get-DbaPfDataCollectorSet | Select-Object -First 1
$TestConfig.set | Stop-DbaPfDataCollectorSet -WarningAction SilentlyContinue
$script:set = Get-DbaPfDataCollectorSet | Select-Object -First 1
$script:set | Stop-DbaPfDataCollectorSet -WarningAction SilentlyContinue
Start-Sleep 2
}
AfterAll {
$TestConfig.set | Stop-DbaPfDataCollectorSet -WarningAction SilentlyContinue
$script:set | Stop-DbaPfDataCollectorSet -WarningAction SilentlyContinue
}
Context "Verifying command works" {
It "returns a result with the right computername and name is not null" {
$results = $TestConfig.set | Select-Object -First 1 | Start-DbaPfDataCollectorSet -WarningAction SilentlyContinue -WarningVariable warn
$results = $script:set | Select-Object -First 1 | Start-DbaPfDataCollectorSet -WarningAction SilentlyContinue -WarningVariable warn
if (-not $warn) {
$results.ComputerName | Should Be $env:COMPUTERNAME
$results.Name | Should Not Be $null
Expand Down
8 changes: 4 additions & 4 deletions tests/Stop-DbaPfDataCollectorSet.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {

Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
BeforeAll {
$TestConfig.set = Get-DbaPfDataCollectorSet | Select-Object -First 1
$TestConfig.set | Start-DbaPfDataCollectorSet -WarningAction SilentlyContinue
$script:set = Get-DbaPfDataCollectorSet | Select-Object -First 1
$script:set | Start-DbaPfDataCollectorSet -WarningAction SilentlyContinue
Start-Sleep 2
}
AfterAll {
$TestConfig.set | Stop-DbaPfDataCollectorSet -WarningAction SilentlyContinue
$script:set | Stop-DbaPfDataCollectorSet -WarningAction SilentlyContinue
}
Context "Verifying command works" {
It "returns a result with the right computername and name is not null" {
$results = $TestConfig.set | Select-Object -First 1 | Stop-DbaPfDataCollectorSet -WarningAction SilentlyContinue -WarningVariable warn
$results = $script:set | Select-Object -First 1 | Stop-DbaPfDataCollectorSet -WarningAction SilentlyContinue -WarningVariable warn
if (-not $warn) {
$results.ComputerName | Should Be $env:COMPUTERNAME
$results.Name | Should Not Be $null
Expand Down

0 comments on commit c19b63a

Please sign in to comment.