Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/powershell/engine/ETS/Adapter.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ Describe "Adapter Tests" -tags "CI" {
It "Can use PSForEach as an alias for the Foreach magic method" {
$x = 5
$x.PSForEach({$_}) | Should -Be 5

$p = $null.PSForEach{"I didn't run"}
$p.GetType().Name | Should -BeExactly 'Collection`1'
$p.Count | Should -BeExactly 0

([pscustomobject]@{ Name = 'bar' }).PSForEach({$_.Name}) | Should -BeExactly 'bar'
}
}

Expand Down Expand Up @@ -249,6 +255,12 @@ Describe "Adapter Tests" -tags "CI" {
It "Can use PSWhere as an alias for the Where magic method" {
$x = 5
$x.PSWhere{$true} | Should -Be 5

$p = $null.PSWhere{"I didn't run"}
$p.GetType().Name | Should -BeExactly 'Collection`1'
$p.Count | Should -BeExactly 0

([pscustomobject]@{ Name = 'bar' }).PSWhere({$_.Name}) | ForEach-Object Name | Should -BeExactly 'bar'
}
}
}
Expand Down
Loading