Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlicanAkkus/2008b6edc93553c07a6a58162e701001 to your computer and use it in GitHub Desktop.
Save AlicanAkkus/2008b6edc93553c07a6a58162e701001 to your computer and use it in GitHub Desktop.
package io.happy.customer
import spock.lang.Specification
import spock.lang.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