From a09937fe4db6840a6dd6d866a8a03d2649cb7cd6 Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Fri, 25 Oct 2024 20:15:46 +0200 Subject: [PATCH] lez see --- .aider/prompts/conventions.md | 10 +++++++--- tests/Add-DbaAgDatabase.Tests.ps1 | 4 +++- tests/Add-DbaAgListener.Tests.ps1 | 4 +++- tests/Add-DbaAgReplica.Tests.ps1 | 4 +++- tests/Add-DbaComputerCertificate.Tests.ps1 | 4 +++- tests/Add-DbaDbMirrorMonitor.Tests.ps1 | 4 +++- tests/Add-DbaDbRoleMember.Tests.ps1 | 4 +++- tests/Add-DbaExtendedProperty.Tests.ps1 | 4 +++- tests/Add-DbaPfDataCollectorCounter.Tests.ps1 | 4 +++- tests/Add-DbaRegServer.Tests.ps1 | 4 +++- tests/Add-DbaRegServerGroup.Tests.ps1 | 4 +++- tests/Add-DbaServerRoleMember.Tests.ps1 | 4 +++- tests/Backup-DbaComputerCertificate.Tests.ps1 | 4 +++- tests/Backup-DbaDbCertificate.Tests.ps1 | 4 +++- tests/Backup-DbaServiceMasterKey.Tests.ps1 | 4 +++- tests/Clear-DbaConnectionPool.Tests.ps1 | 4 +++- tests/Clear-DbaLatchStatistics.Tests.ps1 | 4 +++- tests/Clear-DbaPlanCache.Tests.ps1 | 4 +++- tests/Clear-DbaWaitStatistics.Tests.ps1 | 4 +++- tests/Convert-DbaLsn.Tests.ps1 | 4 +++- tests/Convert-DbaMaskingValue.Tests.ps1 | 4 +++- tests/ConvertTo-DbaTimeline.Tests.ps1 | 4 +++- tests/ConvertTo-DbaXESession.Tests.ps1 | 4 +++- tests/Copy-DbaAgentAlert.Tests.ps1 | 4 +++- tests/Copy-DbaAgentJob.Tests.ps1 | 4 +++- tests/Copy-DbaAgentJobCategory.Tests.ps1 | 4 +++- tests/Copy-DbaAgentOperator.Tests.ps1 | 4 +++- 27 files changed, 85 insertions(+), 29 deletions(-) diff --git a/.aider/prompts/conventions.md b/.aider/prompts/conventions.md index d5484a94ed..f7ba844286 100644 --- a/.aider/prompts/conventions.md +++ b/.aider/prompts/conventions.md @@ -132,7 +132,9 @@ Describe "Get-DbaDatabase" -Tag "UnitTests" { $expected += @( "SqlInstance", "SqlCredential", - "Database" + "Database", + "Confirm", + "WhatIf" ) } @@ -169,9 +171,11 @@ Describe "Get-DbaDatabase" -Tag "IntegrationTests" { } ``` -## DO NOT +## Additional instructions + - DO NOT use `$MyInvocation.MyCommand.Name` to get command names - DO NOT use the old `knownParameters` validation approach - DO NOT include loose code outside of proper test blocks - DO NOT remove comments like "#TestConfig.instance3" or "#$TestConfig.instance2 for appveyor" -- DO NOT use $_ DO use $PSItem instead \ No newline at end of file +- DO NOT use $_ DO use $PSItem instead +- Parameter validation is ALWAYS tagged as a Unit Test \ No newline at end of file diff --git a/tests/Add-DbaAgDatabase.Tests.ps1 b/tests/Add-DbaAgDatabase.Tests.ps1 index 2db0fbec1a..0c8da3fe8a 100644 --- a/tests/Add-DbaAgDatabase.Tests.ps1 +++ b/tests/Add-DbaAgDatabase.Tests.ps1 @@ -20,7 +20,9 @@ Describe "Add-DbaAgDatabase" -Tag "UnitTests" { "SharedPath", "UseLastBackup", "AdvancedBackupParams", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaAgListener.Tests.ps1 b/tests/Add-DbaAgListener.Tests.ps1 index e2816eafc2..d35a3e925e 100644 --- a/tests/Add-DbaAgListener.Tests.ps1 +++ b/tests/Add-DbaAgListener.Tests.ps1 @@ -20,7 +20,9 @@ Describe "Add-DbaAgListener" -Tag "UnitTests" { "Dhcp", "Passthru", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaAgReplica.Tests.ps1 b/tests/Add-DbaAgReplica.Tests.ps1 index 1a827a8efb..2dced103eb 100644 --- a/tests/Add-DbaAgReplica.Tests.ps1 +++ b/tests/Add-DbaAgReplica.Tests.ps1 @@ -28,7 +28,9 @@ Describe "Add-DbaAgReplica" -Tag "UnitTests" { "ConfigureXESession", "SessionTimeout", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaComputerCertificate.Tests.ps1 b/tests/Add-DbaComputerCertificate.Tests.ps1 index bacfd155e9..c6753f1c6f 100644 --- a/tests/Add-DbaComputerCertificate.Tests.ps1 +++ b/tests/Add-DbaComputerCertificate.Tests.ps1 @@ -17,7 +17,9 @@ Describe "Add-DbaComputerCertificate" -Tag "UnitTests" { "Store", "Folder", "Flag", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaDbMirrorMonitor.Tests.ps1 b/tests/Add-DbaDbMirrorMonitor.Tests.ps1 index 7802a8d941..e10a4ec812 100644 --- a/tests/Add-DbaDbMirrorMonitor.Tests.ps1 +++ b/tests/Add-DbaDbMirrorMonitor.Tests.ps1 @@ -11,7 +11,9 @@ Describe "Add-DbaDbMirrorMonitor" -Tag "UnitTests" { $expected += @( "SqlInstance", "SqlCredential", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaDbRoleMember.Tests.ps1 b/tests/Add-DbaDbRoleMember.Tests.ps1 index fe61aff570..493f027c3e 100644 --- a/tests/Add-DbaDbRoleMember.Tests.ps1 +++ b/tests/Add-DbaDbRoleMember.Tests.ps1 @@ -15,7 +15,9 @@ Describe "Add-DbaDbRoleMember" -Tag "UnitTests" { "Role", "Member", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaExtendedProperty.Tests.ps1 b/tests/Add-DbaExtendedProperty.Tests.ps1 index cf65b1fd4e..8694a1dc58 100644 --- a/tests/Add-DbaExtendedProperty.Tests.ps1 +++ b/tests/Add-DbaExtendedProperty.Tests.ps1 @@ -15,7 +15,9 @@ Describe "Add-DbaExtendedProperty" -Tag "UnitTests" { "Name", "Value", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 b/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 index 7cb4cd0ad7..641a10d9c5 100644 --- a/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 +++ b/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 @@ -15,7 +15,9 @@ Describe "Add-DbaPfDataCollectorCounter" -Tag "UnitTests" { "Collector", "Counter", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaRegServer.Tests.ps1 b/tests/Add-DbaRegServer.Tests.ps1 index c2cefd8f94..6c30c765ad 100644 --- a/tests/Add-DbaRegServer.Tests.ps1 +++ b/tests/Add-DbaRegServer.Tests.ps1 @@ -21,7 +21,9 @@ Describe "Add-DbaRegServer" -Tag "UnitTests" { "OtherParams", "InputObject", "ServerObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaRegServerGroup.Tests.ps1 b/tests/Add-DbaRegServerGroup.Tests.ps1 index 41da8ed6f6..0d653f71d5 100644 --- a/tests/Add-DbaRegServerGroup.Tests.ps1 +++ b/tests/Add-DbaRegServerGroup.Tests.ps1 @@ -15,7 +15,9 @@ Describe "Add-DbaRegServerGroup" -Tag "UnitTests" { "Description", "Group", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Add-DbaServerRoleMember.Tests.ps1 b/tests/Add-DbaServerRoleMember.Tests.ps1 index d298100480..926ced05a0 100644 --- a/tests/Add-DbaServerRoleMember.Tests.ps1 +++ b/tests/Add-DbaServerRoleMember.Tests.ps1 @@ -15,7 +15,9 @@ Describe "Add-DbaServerRoleMember" -Tag "UnitTests" { "Login", "Role", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Backup-DbaComputerCertificate.Tests.ps1 b/tests/Backup-DbaComputerCertificate.Tests.ps1 index 291dc6eecf..729ce0451f 100644 --- a/tests/Backup-DbaComputerCertificate.Tests.ps1 +++ b/tests/Backup-DbaComputerCertificate.Tests.ps1 @@ -14,7 +14,9 @@ Describe "Backup-DbaComputerCertificate" -Tag "UnitTests" { "Path", "FilePath", "Type", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Backup-DbaDbCertificate.Tests.ps1 b/tests/Backup-DbaDbCertificate.Tests.ps1 index 3e8b5ab082..c4960b11bd 100644 --- a/tests/Backup-DbaDbCertificate.Tests.ps1 +++ b/tests/Backup-DbaDbCertificate.Tests.ps1 @@ -19,7 +19,9 @@ Describe "Backup-DbaDbCertificate" -Tag "UnitTests" { "Path", "Suffix", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Backup-DbaServiceMasterKey.Tests.ps1 b/tests/Backup-DbaServiceMasterKey.Tests.ps1 index 9c55f1bede..120207f18b 100644 --- a/tests/Backup-DbaServiceMasterKey.Tests.ps1 +++ b/tests/Backup-DbaServiceMasterKey.Tests.ps1 @@ -14,7 +14,9 @@ Describe "Backup-DbaServiceMasterKey" -Tag "UnitTests" { "KeyCredential", "SecurePassword", "Path", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Clear-DbaConnectionPool.Tests.ps1 b/tests/Clear-DbaConnectionPool.Tests.ps1 index 722abe610d..121c591f56 100644 --- a/tests/Clear-DbaConnectionPool.Tests.ps1 +++ b/tests/Clear-DbaConnectionPool.Tests.ps1 @@ -11,7 +11,9 @@ Describe "Clear-DbaConnectionPool" -Tag "UnitTests" { $expected += @( "ComputerName", "Credential", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Clear-DbaLatchStatistics.Tests.ps1 b/tests/Clear-DbaLatchStatistics.Tests.ps1 index 23782a98da..0de6622239 100644 --- a/tests/Clear-DbaLatchStatistics.Tests.ps1 +++ b/tests/Clear-DbaLatchStatistics.Tests.ps1 @@ -11,7 +11,9 @@ Describe "Clear-DbaLatchStatistics" -Tag "UnitTests" { $expected += @( "SqlInstance", "SqlCredential", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Clear-DbaPlanCache.Tests.ps1 b/tests/Clear-DbaPlanCache.Tests.ps1 index 4bf5e2ee87..a7b3d2df1b 100644 --- a/tests/Clear-DbaPlanCache.Tests.ps1 +++ b/tests/Clear-DbaPlanCache.Tests.ps1 @@ -13,7 +13,9 @@ Describe "Clear-DbaPlanCache" -Tag "UnitTests" { "SqlCredential", "Threshold", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Clear-DbaWaitStatistics.Tests.ps1 b/tests/Clear-DbaWaitStatistics.Tests.ps1 index db36316143..8e460bfb4e 100644 --- a/tests/Clear-DbaWaitStatistics.Tests.ps1 +++ b/tests/Clear-DbaWaitStatistics.Tests.ps1 @@ -11,7 +11,9 @@ Describe "Clear-DbaWaitStatistics" -Tag "UnitTests" { $expected += @( "SqlInstance", "SqlCredential", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Convert-DbaLsn.Tests.ps1 b/tests/Convert-DbaLsn.Tests.ps1 index d9e4fb0a1a..c6c17c8d3b 100644 --- a/tests/Convert-DbaLsn.Tests.ps1 +++ b/tests/Convert-DbaLsn.Tests.ps1 @@ -10,7 +10,9 @@ Describe "Convert-DbaLSN" -Tag "UnitTests" { $expected += @( "LSN", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Convert-DbaMaskingValue.Tests.ps1 b/tests/Convert-DbaMaskingValue.Tests.ps1 index 4c40917c8b..f7649f7f73 100644 --- a/tests/Convert-DbaMaskingValue.Tests.ps1 +++ b/tests/Convert-DbaMaskingValue.Tests.ps1 @@ -12,7 +12,9 @@ Describe "Convert-DbaMaskingValue" -Tag "UnitTests" { "Value", "DataType", "Nullable", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/ConvertTo-DbaTimeline.Tests.ps1 b/tests/ConvertTo-DbaTimeline.Tests.ps1 index a20c74d9da..d991df2dbc 100644 --- a/tests/ConvertTo-DbaTimeline.Tests.ps1 +++ b/tests/ConvertTo-DbaTimeline.Tests.ps1 @@ -11,7 +11,9 @@ Describe "ConvertTo-DbaTimeline" -Tag "UnitTests" { $expected += @( "InputObject", "ExcludeRowLabel", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/ConvertTo-DbaXESession.Tests.ps1 b/tests/ConvertTo-DbaXESession.Tests.ps1 index a25643c642..312130190a 100644 --- a/tests/ConvertTo-DbaXESession.Tests.ps1 +++ b/tests/ConvertTo-DbaXESession.Tests.ps1 @@ -12,7 +12,9 @@ Describe "ConvertTo-DbaXESession" -Tag "UnitTests" { "InputObject", "Name", "OutputScriptOnly", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Copy-DbaAgentAlert.Tests.ps1 b/tests/Copy-DbaAgentAlert.Tests.ps1 index a943a54cfb..9ff4652075 100644 --- a/tests/Copy-DbaAgentAlert.Tests.ps1 +++ b/tests/Copy-DbaAgentAlert.Tests.ps1 @@ -17,7 +17,9 @@ Describe "Copy-DbaAgentAlert" -Tag "UnitTests" { "ExcludeAlert", "IncludeDefaults", "Force", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Copy-DbaAgentJob.Tests.ps1 b/tests/Copy-DbaAgentJob.Tests.ps1 index ae1d53c098..5a385f42f5 100644 --- a/tests/Copy-DbaAgentJob.Tests.ps1 +++ b/tests/Copy-DbaAgentJob.Tests.ps1 @@ -30,7 +30,9 @@ Describe "Copy-DbaAgentJob" -Tag "IntegrationTests" { "DisableOnDestination", "Force", "InputObject", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Copy-DbaAgentJobCategory.Tests.ps1 b/tests/Copy-DbaAgentJobCategory.Tests.ps1 index 2a1a779b8d..e65f1f4daf 100644 --- a/tests/Copy-DbaAgentJobCategory.Tests.ps1 +++ b/tests/Copy-DbaAgentJobCategory.Tests.ps1 @@ -25,7 +25,9 @@ Describe "Copy-DbaAgentJobCategory" -Tag "IntegrationTests" { "AgentCategory", "OperatorCategory", "Force", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) } diff --git a/tests/Copy-DbaAgentOperator.Tests.ps1 b/tests/Copy-DbaAgentOperator.Tests.ps1 index 5bcb781beb..2432675c3a 100644 --- a/tests/Copy-DbaAgentOperator.Tests.ps1 +++ b/tests/Copy-DbaAgentOperator.Tests.ps1 @@ -16,7 +16,9 @@ Describe "Copy-DbaAgentOperator" -Tag "UnitTests" { "Operator", "ExcludeOperator", "Force", - "EnableException" + "EnableException", + "Confirm", + "WhatIf" ) }