Merge pull request 204 from dev/new-alias into develop
This commit is contained in:
commit
fb22eabd90
1 changed files with 34 additions and 0 deletions
34
src/pester-tests/Test-New-Alias.Tests.ps1
Normal file
34
src/pester-tests/Test-New-Alias.Tests.ps1
Normal file
|
@ -0,0 +1,34 @@
|
|||
Describe "Test-New-Alias" {
|
||||
It "Should be able to be called using the name and value parameters without error" {
|
||||
{ New-Alias -Name testAlias -Value 100 } | Should Not Throw
|
||||
}
|
||||
|
||||
It "Should have the same output between the alias and the original cmdlet" {
|
||||
New-Alias -Name testAlias -Value Get-Process
|
||||
|
||||
$aliasId = $(testAlias).Id
|
||||
$cmdletId = $(Get-Process).Id
|
||||
foreach ($IdNumber in $aliasId)
|
||||
{
|
||||
$aliasId[$IdNumber] | Should Be $cmdletId[$IdNumber]
|
||||
}
|
||||
}
|
||||
|
||||
It "Should be able to call the New-Alias cmdlet using the nal alias without error" {
|
||||
{ nal -Name testAlias -Value 100 } | Should Not Throw
|
||||
}
|
||||
|
||||
It "Should have the same output between the nal alias and the New-Alias cmdlet" {
|
||||
nal -Name testAlias -Value Get-Process
|
||||
|
||||
New-Alias -Name testalias2 -Value Get-Process
|
||||
|
||||
$aliasData = $(testAlias).Id
|
||||
$cmdletData = $(testAlias2).Id
|
||||
|
||||
foreach ($IdNumber in $aliasData)
|
||||
{
|
||||
$aliasData[$IdNumber] | Should Be $cmdletData[$IdNumber]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue