Created
May 4, 2019 19:00
-
-
Save AlicanAkkus/dc95dd1429a8b4e3d4f79d307dcc4a2c to your computer and use it in GitHub Desktop.
data table test with unroll
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
class OrderCommissionCalculatorTest extends Specification { | |
def orderCommissionCalculator = new OrderCommissionCalculator() | |
@Unroll | |
void "should calculate #paymentType order commission as #expectedAmount when price is #price"() { | |
expect: | |
expectedAmount == orderCommissionCalculator.calculate(paymentType, price) | |
where: | |
paymentType | price | expectedAmount | |
"CARD" | 100 | 2.3 | |
"CARD" | 80 | 1.84 | |
"CASH" | 100 | 2.0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment