Skip to content

Commit

Permalink
fix scope
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 26, 2024
1 parent 2339c66 commit e26b8b7
Show file tree
Hide file tree
Showing 28 changed files with 58 additions and 58 deletions.
4 changes: 2 additions & 2 deletions tests/Add-DbaAgDatabase.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaAgDatabase" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaAgDatabase
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"AvailabilityGroup",
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaAgListener.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaAgListener" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaAgListener
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"AvailabilityGroup",
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaAgReplica.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaAgReplica" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaAgReplica
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"Name",
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaComputerCertificate.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaComputerCertificate" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaComputerCertificate
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"ComputerName",
"Credential",
"SecurePassword",
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaDbMirrorMonitor.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaDbMirrorMonitor" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaDbMirrorMonitor
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"EnableException",
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaDbRoleMember.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaDbRoleMember" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaDbRoleMember
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"Database",
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaExtendedProperty.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaExtendedProperty" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaExtendedProperty
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"Database",
Expand Down
6 changes: 3 additions & 3 deletions tests/Add-DbaPfDataCollectorCounter.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ param(
$ModuleName = "dbatools",
$PSDefaultParameterValues = ($TestConfig = Get-TestConfig).Defaults
)

Describe "Add-DbaPfDataCollectorCounter" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaPfDataCollectorCounter
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"ComputerName",
"Credential",
"CollectorSet",
Expand All @@ -27,6 +26,7 @@ Describe "Add-DbaPfDataCollectorCounter" -Tag "UnitTests" {
}

It "Should have exactly the number of expected parameters" {
$expected.count | Write-Warning
$hasparms = $command.Parameters.Values.Name
Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaRegServer.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaRegServer" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaRegServer
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"ServerName",
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaRegServerGroup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaRegServerGroup" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaRegServerGroup
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"Name",
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaReplArticle.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaReplArticle" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaReplArticle
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"Database",
Expand Down
4 changes: 2 additions & 2 deletions tests/Add-DbaServerRoleMember.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Add-DbaServerRoleMember" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Add-DbaServerRoleMember
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"ServerRole",
Expand Down
4 changes: 2 additions & 2 deletions tests/Backup-DbaComputerCertificate.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Backup-DbaComputerCertificate" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Backup-DbaComputerCertificate
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SecurePassword",
"InputObject",
"Path",
Expand Down
4 changes: 2 additions & 2 deletions tests/Backup-DbaDbCertificate.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Backup-DbaDbCertificate" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Backup-DbaDbCertificate
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"Certificate",
Expand Down
4 changes: 2 additions & 2 deletions tests/Backup-DbaDbMasterKey.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Backup-DbaDbMasterKey" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Backup-DbaDbMasterKey
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"Credential",
Expand Down
4 changes: 2 additions & 2 deletions tests/Backup-DbaServiceMasterKey.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Backup-DbaServiceMasterKey" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Backup-DbaServiceMasterKey
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"KeyCredential",
Expand Down
4 changes: 2 additions & 2 deletions tests/Clear-DbaConnectionPool.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Clear-DbaConnectionPool" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Clear-DbaConnectionPool
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"ComputerName",
"Credential",
"EnableException"
Expand Down
4 changes: 2 additions & 2 deletions tests/Clear-DbaLatchStatistics.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Clear-DbaLatchStatistics" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Clear-DbaLatchStatistics
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"EnableException",
Expand Down
4 changes: 2 additions & 2 deletions tests/Clear-DbaPlanCache.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Clear-DbaPlanCache" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Clear-DbaPlanCache
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"Threshold",
Expand Down
4 changes: 2 additions & 2 deletions tests/Clear-DbaWaitStatistics.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Clear-DbaWaitStatistics" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Clear-DbaWaitStatistics
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"SqlInstance",
"SqlCredential",
"EnableException",
Expand Down
4 changes: 2 additions & 2 deletions tests/Convert-DbaLsn.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Convert-DbaLSN" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Convert-DbaLSN
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"LSN",
"EnableException"
)
Expand Down
4 changes: 2 additions & 2 deletions tests/Convert-DbaMaskingValue.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Convert-DbaMaskingValue" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Convert-DbaMaskingValue
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"Value",
"DataType",
"Nullable",
Expand Down
4 changes: 2 additions & 2 deletions tests/ConvertTo-DbaTimeline.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "ConvertTo-DbaTimeline" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command ConvertTo-DbaTimeline
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"InputObject",
"ExcludeRowLabel",
"EnableException"
Expand Down
4 changes: 2 additions & 2 deletions tests/ConvertTo-DbaXESession.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "ConvertTo-DbaXESession" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command ConvertTo-DbaXESession
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"InputObject",
"Name",
"OutputScriptOnly",
Expand Down
4 changes: 2 additions & 2 deletions tests/Copy-DbaAgentAlert.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Copy-DbaAgentAlert" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Copy-DbaAgentAlert
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"Source",
"SourceSqlCredential",
"Destination",
Expand Down
4 changes: 2 additions & 2 deletions tests/Copy-DbaAgentJob.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Describe "Copy-DbaAgentJob" -Tag "IntegrationTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Copy-DbaAgentJob
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"Source",
"SourceSqlCredential",
"Destination",
Expand Down
6 changes: 3 additions & 3 deletions tests/Copy-DbaAgentJobCategory.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Describe "Copy-DbaAgentJobCategory" -Tag "IntegrationTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Copy-DbaAgentJobCategory
$expected = $TestConfig.CommonParameters
$expected += @(

$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"Source",
"SourceSqlCredential",
"Destination",
Expand Down
4 changes: 2 additions & 2 deletions tests/Copy-DbaAgentOperator.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Describe "Copy-DbaAgentOperator" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Copy-DbaAgentOperator
$expected = $TestConfig.CommonParameters
$expected += @(
$script:expected = $TestConfig.CommonParameters
$script:expected += @(
"Source",
"SourceSqlCredential",
"Destination",
Expand Down

0 comments on commit e26b8b7

Please sign in to comment.