Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlicanAkkus/ba12b407c91e4b0fd2d9d80d7bfb5c20 to your computer and use it in GitHub Desktop.
Save AlicanAkkus/ba12b407c91e4b0fd2d9d80d7bfb5c20 to your computer and use it in GitHub Desktop.
spock test
class OrderCommissionCalculatorTest extends Specification {
def orderCommissionCalculator = new OrderCommissionCalculator()
void "should calculate order commission amount"() {
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