Skip to content

Instantly share code, notes, and snippets.

@markwragg
Created August 17, 2018 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markwragg/d5e35fc5c8de1f9a9bd992016b88d0c4 to your computer and use it in GitHub Desktop.
Save markwragg/d5e35fc5c8de1f9a9bd992016b88d0c4 to your computer and use it in GitHub Desktop.
Add one tests
function AddOne ([int16]$Num) {
$Num = $Num + 1
Return $Num
}
Describe 'Add One Tests' {
32000..32766 | ForEach-Object {
It "Should Add 1 to $_" {
AddOne $_ | Should -Be ($_ + 1)
}
}
32767..33000 | ForEach-Object {
It "Should Throw for $_" {
{ AddOne $_ } | Should -Throw
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment