Created
December 23, 2019 13:08
-
-
Save nohwnd/5e8ff93281e3de98b2a6110322129827 to your computer and use it in GitHub Desktop.
Compound assertions example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Describe "In Pester v5 assertions don't fail by default" { | |
It "is awesome for ensuring a lot of stuff about single object" { | |
$user = @{ | |
Name = 'Jakub' | |
Age = 31 | |
Languages = [PSCustomObject]@{ | |
Speaking = 'Czech', 'English' | |
Programming = @( | |
'C#' | |
'PowerShell' | |
'F#' | |
'go' | |
'TypeScript' | |
) | |
} | |
} | |
$user | Should -Not -BeNullOrEmpty -ErrorAction Stop | |
$user.Name | Should -Be 'Tomas' | |
$user.Age | Should -Be 27 | |
$user.Languages.Speaking.Count | Should -Be 3 | |
$user.Languages.Speaking | Should -Contain 'Portugese' | |
$user.Languages.Speaking | Should -Contain 'German' | |
$user.Languages.Speaking | Should -Contain 'Russian' | |
$user.Languages.Programming | Should -Be @( | |
"Erlang" | |
"Java" | |
"Agda" | |
"Coq" | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment