Merge pull request #866 from PowerShell/UpdateNewAliasPesterTest

Update New-Alias Pester Unit Test
This commit is contained in:
Andy Schwartzmeyer
2016-04-22 11:49:42 -07:00
+3 -2
View File
@@ -1,11 +1,12 @@
Describe "New-Alias DRT Unit Tests" -Tags DRT{
It "New-Alias Constant should throw SessionStateException skip now as bug#777" -Skip:$true{
It "New-Alias Constant should throw SessionStateUnauthorizedAccessException"{
try {
New-Alias -Name "ABCD" -Value "foo" -Option "Constant" -Force:$true
New-Alias -Name "ABCD" -Value "foo" -Force:$true
New-Alias -Name "ABCD" -Value "foo" -Force:$true -ErrorAction Stop
Throw "Execution OK"
}
catch {
$_.CategoryInfo| Should Match "SessionStateUnauthorizedAccessException"
$_.FullyQualifiedErrorId | Should be "AliasNotWritable,Microsoft.PowerShell.Commands.NewAliasCommand"
}
}