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 x
- The Catalog should list the names of the currently available fruit in alphabetical order x
- The Catalog should report the price of a given type of fruit x
- The Catalog should throw a FruitUnavailableException if the fruit is not currently available !!!!
- You can add items to your shopping cart, which should keep a running total.
- When you buy 5 kilos or more of any fruit, you get a 10% discount. x
You should end up with at least 10 test cases. The first one is written for you.