Created
May 4, 2019 20:09
-
-
Save AlicanAkkus/2008b6edc93553c07a6a58162e701001 to your computer and use it in GitHub Desktop.
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
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