Skip to content

Commit

Permalink
no params
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 28, 2024
1 parent 07eb946 commit f839a4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
3 changes: 2 additions & 1 deletion private/testing/Get-TestConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ function Get-TestConfig {
$config['CommandName'] = "Unknown"
}

$config['CommonParameters'] = [System.Management.Automation.PSCmdlet]::CommonParameters
# sometimes the enumeration doesn't work, so we'll just hardcode it
$config['CommonParameters'] = "Verbose", "Debug", "ErrorAction", "WarningAction", "InformationAction", "ProgressAction", "ErrorVariable", "WarningVariable", "OutVariable", "OutBuffer", "PipelineVariable", "InformationVariable"

[pscustomobject]$config
}
18 changes: 1 addition & 17 deletions tests/Get-DbaConnectedInstance.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,7 @@ param(
$PSDefaultParameterValues = ($TestConfig = Get-TestConfig).Defaults
)

Describe "Get-DbaConnectedInstance" -Tag "UnitTests" {
BeforeAll {
$command = Get-Command Get-DbaConnectedInstance
$expected = $TestConfig.CommonParameters
}

Context "Parameter validation" {
It "Has parameter: <_>" -ForEach $expected {
$command | Should -HaveParameter $PSItem
}

It "Should have exactly the number of expected parameters ($($expected.Count))" {
$hasparms = $command.Parameters.Values.Name
Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty
}
}
}
# no params to test

Describe "Get-DbaConnectedInstance" -Tag "IntegrationTests" {
BeforeAll {
Expand Down

0 comments on commit f839a4b

Please sign in to comment.