Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Nov 1, 2024
1 parent c03dc65 commit 84c00ee
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tests/Export-DbaPfDataCollectorSetTemplate.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Export-DbaPfDataCollectorSetTemplate" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"ComputerName",
"Credential",
"Credential",
"CollectorSet",
"Path",
"FilePath",
Expand Down
4 changes: 2 additions & 2 deletions tests/Export-DbaServerRole.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Export-DbaServerRole" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
'SqlInstance',
'SqlCredential',
'SqlCredential',
'InputObject',
'ScriptingOptionsObject',
'ServerRole',
Expand Down Expand Up @@ -45,7 +45,7 @@ Describe "Export-DbaServerRole" -Tags "IntegrationTests" {
BeforeAll {
$AltExportPath = "$env:USERPROFILE\Documents"
$outputFile = "$AltExportPath\Dbatoolsci_ServerRole.sql"

$random = Get-Random
$login1 = "dbatoolsci_exportdbaserverrole_login1$random"
$svRole = "dbatoolsci_ScriptPermissions$random"
Expand Down
2 changes: 1 addition & 1 deletion tests/Export-DbaSpConfigure.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Export-DbaSpConfigure" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"Path",
"FilePath",
"EnableException"
Expand Down
2 changes: 1 addition & 1 deletion tests/Export-DbaXECsv.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Export-DbaXECsv" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"InputObject",
"Path",
"Path",
"FilePath",
"EnableException"
)
Expand Down
6 changes: 3 additions & 3 deletions tests/Export-DbaXESessionTemplate.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Export-DbaXESessionTemplate" -Tag "UnitTests" {
$expectedParams = $TestConfig.CommonParameters
$expectedParams += @(
'SqlInstance',
'SqlCredential',
'SqlCredential',
'Session',
'Path',
'FilePath',
Expand All @@ -35,12 +35,12 @@ Describe "Export-DbaXESessionTemplate" -Tag "IntegrationTests" {
BeforeAll {
$null = Get-DbaXESession -SqlInstance $TestConfig.instance2 -Session 'Profiler TSQL Duration' | Remove-DbaXESession
}

AfterAll {
$null = Get-DbaXESession -SqlInstance $TestConfig.instance2 -Session 'Profiler TSQL Duration' | Remove-DbaXESession
Remove-Item -Path 'C:\windows\temp\Profiler TSQL Duration.xml' -ErrorAction SilentlyContinue
}

Context "When exporting session template" {
BeforeAll {
$session = Import-DbaXESessionTemplate -SqlInstance $TestConfig.instance2 -Template 'Profiler TSQL Duration'
Expand Down
18 changes: 9 additions & 9 deletions tests/Get-DbaConnectedInstance.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ param(
$PSDefaultParameterValues = ($TestConfig = Get-TestConfig).Defaults
)

# no params to test

Describe "Get-DbaConnectedInstance" -Tag "IntegrationTests" {
Describe "Get-DbaConnectedInstance" -Tag "UnitTests" {
BeforeAll {
$null = Get-DbaDatabase -SqlInstance $TestConfig.Instance1
$command = Get-Command Get-DbaConnectedInstance
$expected = $TestConfig.CommonParameters
}

Context "When getting connected instances" {
BeforeAll {
$results = Get-DbaConnectedInstance
Context "Parameter validation" {
It "Has parameter: <_>" -ForEach $expected {
$command | Should -HaveParameter $PSItem
}

It "Returns results" {
$results | Should -Not -BeNullOrEmpty
It "Should have exactly the number of expected parameters ($($expected.Count))" {
$hasParams = $command.Parameters.Values.Name
Compare-Object -ReferenceObject $expected -DifferenceObject $hasParams | Should -BeNullOrEmpty
}
}
}

0 comments on commit 84c00ee

Please sign in to comment.