The Challenge
You've been given a Coffee Shop ordering system that has bugs. Your job is to write tests using Kotest to find and fix them.
The System
A coffee shop that manages:
- Drinks: Espresso, Americano, Cappuccino, Latte, Flat White, Mocha
- Sizes: Small (1x), Medium (1.25x), Large (1.5x price)
- Orders: Customer name + list of drinks
- Receipts: Subtotal, tax, total calculations
Your Tasks
- Read and understand the Coffee Shop code (
PriceCalculator,CoffeeShop) - Write Kotest tests covering:
- Drink price calculation for all sizes
- Order total calculation (including edge cases)
- Tax calculation and discount logic
- Order placement and receipt generation
- Find the bugs - Some tests will fail, revealing hidden bugs!
- Fix the bugs and verify all tests pass
Minimum Requirements
- At least 10 tests for
PriceCalculator - At least 5 tests for
CoffeeShop - Cover edge cases: empty orders, negative values, boundary conditions