Question: We need a module that will act as a checkout system that handles pricing schemes such as apples cost 50 cents, three apples cost $1.30.


  • We need a module that will act as a checkout system that handles pricing schemes such as "apples cost 50 cents, three apples cost $1.30."
  • In a normal supermarket, things are identified using Stock Keeping Units, or SKUs.
    • In our store, we'll use individual letters of the alphabet (A, B, C, and so on).
    • Our goods are priced individually.
    • Some items are multi-priced: buy n of them, and they'll cost you y cents. For example, item 'A' might cost 50 cents individually, but this week we have a special offer: buy three 'A's and they'll cost you $1.30.
  • Our checkout accepts items in any order, so that if we scan a B, an A, and another B, we'll recognize the two B's and price them at 45 (for a total price so far of 95).
  • Because the pricing changes frequently, we need to be able to pass in a set of pricing rules each time we start handling a checkout transaction.
  • Here are this week's rule


  • Next week's rules will be different



Objective

Write Acceptance tests using Gherkin for the above requirements.


Following the process from this week's lecture to define each feature and its scenarios.


Save everything in a file called "LASTNAME_FIRSTNAME_checkout.feature".


Use a data table if you see an opportunity


Submit the file to the dropbox.



Marks Available What Are the Marks Awarded For? Marks Awarded

5 Correct use of the Gherkin notation
5 Valid and appropriate tests
5 Good coverage of the requirements
5 Follow all instructions to the letter
___ 20 TOTAL MARKS


Step by Step Solution

3.50 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Heres an example of how you could wr... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!