Created
February 8, 2021 07:14
-
-
Save ivancorrales/64b858af6bba2579bafe8a917682ffd9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# scenario-sub.hcl | |
scenario "operation substract" { | |
examples = [ | |
{ x = 20, y = 10, subResult= 10}, | |
{ x = 10, y = 20, subResult= 10}, | |
{ x = 5, y = 5, subResult= 0}, | |
] | |
when "subtract y to x" { | |
set result { | |
value = x - y | |
when = x > y | |
} | |
set result { | |
value = y - x | |
when = x <= y | |
} | |
} | |
then "the result of the operation is the expected" { | |
assert { | |
assertion = result==subResult | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment