Created
August 17, 2018 10:27
-
-
Save markwragg/d5e35fc5c8de1f9a9bd992016b88d0c4 to your computer and use it in GitHub Desktop.
Add one tests
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
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