February 2015
Intermediate to advanced
338 pages
8h 16m
English
To get the last step working, change the last step definition in step_definitions/CheckoutSteps.java to look like this:
| first_taste/10/step_definitions/CheckoutSteps.java | |
| | @Then("^the total price should be (\\d+)c$") |
| | public void theTotalPriceShouldBeC(int total) throws Throwable { |
| | assertEquals(total, checkout.total()); |
| | } |
We’re using a JUnit assertion to check that the expected total specified in the feature matches the total from our checkout. If it doesn’t, JUnit will raise an error. Before this can compile, we’ll need to add an import statement to step_definitions/CheckoutSteps.java:
| first_taste/10/step_definitions/CheckoutSteps.java | |
| | import static org.junit.Assert.*; |
We’ll also need to download the ...
Read now
Unlock full access