Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlicanAkkus/dc95dd1429a8b4e3d4f79d307dcc4a2c to your computer and use it in GitHub Desktop.
Save AlicanAkkus/dc95dd1429a8b4e3d4f79d307dcc4a2c to your computer and use it in GitHub Desktop.
data table test with unroll
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