Last active
May 4, 2019 19:21
-
-
Save AlicanAkkus/f4dfb530eafa6dc12a6751264b378bb8 to your computer and use it in GitHub Desktop.
spock test with bdd style
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() | |
void "should calculate card payment order commission"() { | |
given: "card payment and price is 100" | |
def paymentType = "CARD" | |
def price = 100 | |
when: "calculate card payment commission" | |
def commissionAmount = orderCommissionCalculator.calculate(paymentType, price) | |
then: "commission should equal to 2.3" | |
commissionAmount == 2.3 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment