diff --git a/.aider/prompts/conventions.md b/.aider/prompts/conventions.md index 653f1bb1fa..2008800ffa 100644 --- a/.aider/prompts/conventions.md +++ b/.aider/prompts/conventions.md @@ -129,8 +129,8 @@ Describe "Get-DbaDatabase" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Get-DbaDatabase - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "Database", @@ -143,7 +143,7 @@ Describe "Get-DbaDatabase" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaAgDatabase.Tests.ps1 b/tests/Add-DbaAgDatabase.Tests.ps1 index f3027ce059..ccb05af6a2 100644 --- a/tests/Add-DbaAgDatabase.Tests.ps1 +++ b/tests/Add-DbaAgDatabase.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaAgDatabase" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaAgDatabase - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "AvailabilityGroup", @@ -31,7 +31,7 @@ Describe "Add-DbaAgDatabase" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaAgListener.Tests.ps1 b/tests/Add-DbaAgListener.Tests.ps1 index 625928313d..e382a17034 100644 --- a/tests/Add-DbaAgListener.Tests.ps1 +++ b/tests/Add-DbaAgListener.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaAgListener" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaAgListener - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "AvailabilityGroup", @@ -31,7 +31,7 @@ Describe "Add-DbaAgListener" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaAgReplica.Tests.ps1 b/tests/Add-DbaAgReplica.Tests.ps1 index f924fd3de4..c5e9de136c 100644 --- a/tests/Add-DbaAgReplica.Tests.ps1 +++ b/tests/Add-DbaAgReplica.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaAgReplica" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaAgReplica - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "Name", @@ -39,7 +39,7 @@ Describe "Add-DbaAgReplica" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaComputerCertificate.Tests.ps1 b/tests/Add-DbaComputerCertificate.Tests.ps1 index 1a00df9b66..9d29be9fcf 100644 --- a/tests/Add-DbaComputerCertificate.Tests.ps1 +++ b/tests/Add-DbaComputerCertificate.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaComputerCertificate" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaComputerCertificate - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "ComputerName", "Credential", "SecurePassword", @@ -28,7 +28,7 @@ Describe "Add-DbaComputerCertificate" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaDbMirrorMonitor.Tests.ps1 b/tests/Add-DbaDbMirrorMonitor.Tests.ps1 index c6559117a3..f78e90b2a6 100644 --- a/tests/Add-DbaDbMirrorMonitor.Tests.ps1 +++ b/tests/Add-DbaDbMirrorMonitor.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaDbMirrorMonitor" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaDbMirrorMonitor - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "EnableException", @@ -22,7 +22,7 @@ Describe "Add-DbaDbMirrorMonitor" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaDbRoleMember.Tests.ps1 b/tests/Add-DbaDbRoleMember.Tests.ps1 index 57562782af..ec58154baa 100644 --- a/tests/Add-DbaDbRoleMember.Tests.ps1 +++ b/tests/Add-DbaDbRoleMember.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaDbRoleMember" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaDbRoleMember - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "Database", @@ -26,7 +26,7 @@ Describe "Add-DbaDbRoleMember" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaExtendedProperty.Tests.ps1 b/tests/Add-DbaExtendedProperty.Tests.ps1 index 3f578ecc97..1ca2c17d6e 100644 --- a/tests/Add-DbaExtendedProperty.Tests.ps1 +++ b/tests/Add-DbaExtendedProperty.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaExtendedProperty" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaExtendedProperty - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "Database", @@ -26,7 +26,7 @@ Describe "Add-DbaExtendedProperty" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 b/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 index 5da7a03cc8..bbbee53ba7 100644 --- a/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 +++ b/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 @@ -3,12 +3,13 @@ param( $ModuleName = "dbatools", $PSDefaultParameterValues = ($TestConfig = Get-TestConfig).Defaults ) + Describe "Add-DbaPfDataCollectorCounter" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaPfDataCollectorCounter - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "ComputerName", "Credential", "CollectorSet", @@ -25,8 +26,7 @@ Describe "Add-DbaPfDataCollectorCounter" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { - $expected.count | Write-Warning + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaRegServer.Tests.ps1 b/tests/Add-DbaRegServer.Tests.ps1 index ef4d57b114..e0db506d16 100644 --- a/tests/Add-DbaRegServer.Tests.ps1 +++ b/tests/Add-DbaRegServer.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaRegServer" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaRegServer - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "ServerName", @@ -32,7 +32,7 @@ Describe "Add-DbaRegServer" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaRegServerGroup.Tests.ps1 b/tests/Add-DbaRegServerGroup.Tests.ps1 index 9c060a4884..7ab260ea0b 100644 --- a/tests/Add-DbaRegServerGroup.Tests.ps1 +++ b/tests/Add-DbaRegServerGroup.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaRegServerGroup" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaRegServerGroup - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "Name", @@ -26,7 +26,7 @@ Describe "Add-DbaRegServerGroup" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaReplArticle.Tests.ps1 b/tests/Add-DbaReplArticle.Tests.ps1 index 72460ce45c..3da2149402 100644 --- a/tests/Add-DbaReplArticle.Tests.ps1 +++ b/tests/Add-DbaReplArticle.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaReplArticle" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaReplArticle - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "Database", @@ -28,7 +28,7 @@ Describe "Add-DbaReplArticle" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Add-DbaServerRoleMember.Tests.ps1 b/tests/Add-DbaServerRoleMember.Tests.ps1 index 583231b065..145cdbe47b 100644 --- a/tests/Add-DbaServerRoleMember.Tests.ps1 +++ b/tests/Add-DbaServerRoleMember.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Add-DbaServerRoleMember" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Add-DbaServerRoleMember - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "ServerRole", @@ -26,7 +26,7 @@ Describe "Add-DbaServerRoleMember" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Backup-DbaComputerCertificate.Tests.ps1 b/tests/Backup-DbaComputerCertificate.Tests.ps1 index 47d620e45a..9b49077d08 100644 --- a/tests/Backup-DbaComputerCertificate.Tests.ps1 +++ b/tests/Backup-DbaComputerCertificate.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Backup-DbaComputerCertificate" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Backup-DbaComputerCertificate - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SecurePassword", "InputObject", "Path", @@ -23,7 +23,7 @@ Describe "Backup-DbaComputerCertificate" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Backup-DbaDbCertificate.Tests.ps1 b/tests/Backup-DbaDbCertificate.Tests.ps1 index e1b653b9cb..3957909fdd 100644 --- a/tests/Backup-DbaDbCertificate.Tests.ps1 +++ b/tests/Backup-DbaDbCertificate.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Backup-DbaDbCertificate" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Backup-DbaDbCertificate - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "Certificate", @@ -30,7 +30,7 @@ Describe "Backup-DbaDbCertificate" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Backup-DbaDbMasterKey.Tests.ps1 b/tests/Backup-DbaDbMasterKey.Tests.ps1 index 5ab04c5e48..28a23ddbb9 100644 --- a/tests/Backup-DbaDbMasterKey.Tests.ps1 +++ b/tests/Backup-DbaDbMasterKey.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Backup-DbaDbMasterKey" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Backup-DbaDbMasterKey - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "Credential", @@ -28,7 +28,7 @@ Describe "Backup-DbaDbMasterKey" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Backup-DbaServiceMasterKey.Tests.ps1 b/tests/Backup-DbaServiceMasterKey.Tests.ps1 index 75efc60ce7..c81c81b578 100644 --- a/tests/Backup-DbaServiceMasterKey.Tests.ps1 +++ b/tests/Backup-DbaServiceMasterKey.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Backup-DbaServiceMasterKey" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Backup-DbaServiceMasterKey - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "KeyCredential", @@ -25,7 +25,7 @@ Describe "Backup-DbaServiceMasterKey" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Clear-DbaConnectionPool.Tests.ps1 b/tests/Clear-DbaConnectionPool.Tests.ps1 index f0323ce1d0..cd92862fd7 100644 --- a/tests/Clear-DbaConnectionPool.Tests.ps1 +++ b/tests/Clear-DbaConnectionPool.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Clear-DbaConnectionPool" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Clear-DbaConnectionPool - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "ComputerName", "Credential", "EnableException" @@ -20,7 +20,7 @@ Describe "Clear-DbaConnectionPool" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Clear-DbaLatchStatistics.Tests.ps1 b/tests/Clear-DbaLatchStatistics.Tests.ps1 index c079c1b684..77d72e213c 100644 --- a/tests/Clear-DbaLatchStatistics.Tests.ps1 +++ b/tests/Clear-DbaLatchStatistics.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Clear-DbaLatchStatistics" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Clear-DbaLatchStatistics - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "EnableException", @@ -22,7 +22,7 @@ Describe "Clear-DbaLatchStatistics" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Clear-DbaPlanCache.Tests.ps1 b/tests/Clear-DbaPlanCache.Tests.ps1 index 135ff70c54..de7e1ef729 100644 --- a/tests/Clear-DbaPlanCache.Tests.ps1 +++ b/tests/Clear-DbaPlanCache.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Clear-DbaPlanCache" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Clear-DbaPlanCache - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "Threshold", @@ -24,7 +24,7 @@ Describe "Clear-DbaPlanCache" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Clear-DbaWaitStatistics.Tests.ps1 b/tests/Clear-DbaWaitStatistics.Tests.ps1 index 96f6f74df1..4014ee4a8e 100644 --- a/tests/Clear-DbaWaitStatistics.Tests.ps1 +++ b/tests/Clear-DbaWaitStatistics.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Clear-DbaWaitStatistics" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Clear-DbaWaitStatistics - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "SqlInstance", "SqlCredential", "EnableException", @@ -22,7 +22,7 @@ Describe "Clear-DbaWaitStatistics" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Convert-DbaLsn.Tests.ps1 b/tests/Convert-DbaLsn.Tests.ps1 index 87f76a0730..65108cbf28 100644 --- a/tests/Convert-DbaLsn.Tests.ps1 +++ b/tests/Convert-DbaLsn.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Convert-DbaLSN" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Convert-DbaLSN - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "LSN", "EnableException" ) @@ -19,7 +19,7 @@ Describe "Convert-DbaLSN" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Convert-DbaMaskingValue.Tests.ps1 b/tests/Convert-DbaMaskingValue.Tests.ps1 index 22852a8e50..f21519aed2 100644 --- a/tests/Convert-DbaMaskingValue.Tests.ps1 +++ b/tests/Convert-DbaMaskingValue.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Convert-DbaMaskingValue" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Convert-DbaMaskingValue - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "Value", "DataType", "Nullable", @@ -21,7 +21,7 @@ Describe "Convert-DbaMaskingValue" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/ConvertTo-DbaTimeline.Tests.ps1 b/tests/ConvertTo-DbaTimeline.Tests.ps1 index a032e4128f..b2feda3395 100644 --- a/tests/ConvertTo-DbaTimeline.Tests.ps1 +++ b/tests/ConvertTo-DbaTimeline.Tests.ps1 @@ -8,8 +8,8 @@ Describe "ConvertTo-DbaTimeline" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command ConvertTo-DbaTimeline - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "InputObject", "ExcludeRowLabel", "EnableException" @@ -20,7 +20,7 @@ Describe "ConvertTo-DbaTimeline" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/ConvertTo-DbaXESession.Tests.ps1 b/tests/ConvertTo-DbaXESession.Tests.ps1 index 6adad2f5f9..29227043b2 100644 --- a/tests/ConvertTo-DbaXESession.Tests.ps1 +++ b/tests/ConvertTo-DbaXESession.Tests.ps1 @@ -8,8 +8,8 @@ Describe "ConvertTo-DbaXESession" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command ConvertTo-DbaXESession - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "InputObject", "Name", "OutputScriptOnly", @@ -23,7 +23,7 @@ Describe "ConvertTo-DbaXESession" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Copy-DbaAgentAlert.Tests.ps1 b/tests/Copy-DbaAgentAlert.Tests.ps1 index 57e36badc7..075cfffb58 100644 --- a/tests/Copy-DbaAgentAlert.Tests.ps1 +++ b/tests/Copy-DbaAgentAlert.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Copy-DbaAgentAlert" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Copy-DbaAgentAlert - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "Source", "SourceSqlCredential", "Destination", @@ -28,7 +28,7 @@ Describe "Copy-DbaAgentAlert" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Copy-DbaAgentJob.Tests.ps1 b/tests/Copy-DbaAgentJob.Tests.ps1 index 2d425f4c4c..9e466da013 100644 --- a/tests/Copy-DbaAgentJob.Tests.ps1 +++ b/tests/Copy-DbaAgentJob.Tests.ps1 @@ -19,8 +19,8 @@ Describe "Copy-DbaAgentJob" -Tag "IntegrationTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Copy-DbaAgentJob - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "Source", "SourceSqlCredential", "Destination", @@ -41,7 +41,7 @@ Describe "Copy-DbaAgentJob" -Tag "IntegrationTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Copy-DbaAgentJobCategory.Tests.ps1 b/tests/Copy-DbaAgentJobCategory.Tests.ps1 index ab0987bcf2..79ef6ca357 100644 --- a/tests/Copy-DbaAgentJobCategory.Tests.ps1 +++ b/tests/Copy-DbaAgentJobCategory.Tests.ps1 @@ -16,8 +16,8 @@ Describe "Copy-DbaAgentJobCategory" -Tag "IntegrationTests" { BeforeAll { $command = Get-Command Copy-DbaAgentJobCategory - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "Source", "SourceSqlCredential", "Destination", @@ -37,7 +37,7 @@ Describe "Copy-DbaAgentJobCategory" -Tag "IntegrationTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty } diff --git a/tests/Copy-DbaAgentOperator.Tests.ps1 b/tests/Copy-DbaAgentOperator.Tests.ps1 index e9652fb8f9..846e46d8b1 100644 --- a/tests/Copy-DbaAgentOperator.Tests.ps1 +++ b/tests/Copy-DbaAgentOperator.Tests.ps1 @@ -8,8 +8,8 @@ Describe "Copy-DbaAgentOperator" -Tag "UnitTests" { Context "Parameter validation" { BeforeAll { $command = Get-Command Copy-DbaAgentOperator - $script:expected = $TestConfig.CommonParameters - $script:expected += @( + $expected = $TestConfig.CommonParameters + $expected += @( "Source", "SourceSqlCredential", "Destination", @@ -27,7 +27,7 @@ Describe "Copy-DbaAgentOperator" -Tag "UnitTests" { $command | Should -HaveParameter $PSItem } - It "Should have exactly the number of expected parameters" { + It "Should have exactly the number of expected parameters ($($expected.Count))" { $hasparms = $command.Parameters.Values.Name Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty }