In this exercise, your challenge is to write a Fruit Shop Cart Calculator. Write tests code to illustrate the following requirements, and write the additional application code you need to make them work:
- The shop sells apples, oranges, bananas, pears, peaches and other fruit, depending on availability. For example the prices per kilo for the currently available fruit are:
- Apples: $4.00
- Oranges: $5.50
- Bananas: $6.00
- Pears: $4.50
- You can update the catalog with the current market price of a fruit
- The Catalog should list the names of the currently available fruit in alphabetical order
- The Catalog should report the price of a given type of fruit
- You can add items to your shopping cart, which should keep a running total.
- The Catalog should throw a FruitUnavailableException if the fruit is not currently available
- When you buy 5 kilos or more of any fruit, you get a 10% discount.
You should end up with at least 10 test cases. See the catalog test to get started.