Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Assert-ArrayEquality($test, $expected) {
- $test | Should -HaveCount $expected.Count
- 0..($test.Count - 1) | % {$test[$_] | Should -Be $expected[$_]}
- }
- function Assert-HashtableEquality($test, $expected) {
- $test.Keys | Should -HaveCount $expected.Keys.Count
- $test.Keys | % {$test[$_] | Should -Be $expected[$_]}
- }
- function Assert-ObjectEquality($test, $expected) {
- $testKeys = $test.psobject.Properties | % Name
- $expectedKeys = $test.psobject.Properties | % Name
- $testKeys | Should -HaveCount $expectedKeys.Count
- $testKeys | % {$test.$_ | Should -Be $expected.$_}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement