February 2015
Intermediate to advanced
338 pages
8h 16m
English
To implement the next step, edit step_definitions/CheckoutSteps.java so that the second step definition looks like this:
| first_taste/07/step_definitions/CheckoutSteps.java | |
| | @When("^I checkout (\\d+) \"(.*?)\"$") |
| | public void iCheckout(int itemCount, String itemName) throws Throwable { |
| | Checkout checkout = new Checkout(); |
| | checkout.add(itemCount, bananaPrice); |
| | } |
This code attempts to call an add() on an instance of our Checkout class, passing it the number of items being bought and their price.
This time when we run ./cucumber, we should get a compile error because we haven’t created a Checkout class yet:
| | step_definitions/CheckoutSteps.java:15: error: cannot find symbol |
| | Checkout checkout = ... |
Read now
Unlock full access