Skip to content

Commit 2cca80c

Browse files
committed
Added failing test for issue #158
1 parent efc027a commit 2cca80c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Tests/Rules/AvoidDefaultTrueValueSwitchParameter.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313

1414
# Param2 help description
1515
[switch]
16-
$switch=$true
16+
$switch=$true,
17+
18+
# Param3 help description
19+
[System.Management.Automation.SwitchParameter]
20+
$switch2 = $true
1721
)
1822

1923
Begin

Tests/Rules/AvoidDefaultTrueValueSwitchParameter.tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ $noViolations = Invoke-ScriptAnalyzer $directory\AvoidDefaultTrueValueSwitchPara
77

88
Describe "AvoidDefaultTrueValueSwitchParameter" {
99
Context "When there are violations" {
10-
It "has 1 avoid using switch parameter default to true violation" {
11-
$violations.Count | Should Be 1
10+
It "has 2 avoid using switch parameter default to true violation" {
11+
$violations.Count | Should Be 2
1212
}
1313

1414
It "has the correct description message" {

0 commit comments

Comments
 (0)