Files
PowerShell-PowerShell/test/powershell/engine/Basic/Attributes.Tests.ps1
T
Steve Lee 2639cd89ce Autocorrected CRLF to LF (#4943)
Also, fix `Parser.Tests.ps1` after correcting CRLF.
2017-09-29 16:28:15 -07:00

25 lines
643 B
PowerShell

Describe "Attribute tests" -Tags "CI" {
BeforeEach {
Remove-Item $testdrive/test.ps1 -Force -ErrorAction SilentlyContinue
}
It "<attribute> attribute returns argument error if empty" -TestCases @(
@{Attribute="HelpMessage"},
@{Attribute="HelpMessageBaseName"},
@{Attribute="HelpMessageResourceId"}
) {
param($attribute)
$script = @"
[CmdletBinding()]
Param (
[Parameter($attribute="")]
[String]`$Parameter1
)
Write-Output "Hello"
"@
New-Item -Path $testdrive/test.ps1 -Value $script -ItemType File
{ & $testdrive/test.ps1 } | ShouldBeErrorId "Argument"
}
}