Welcome to the dojo ! Please fork this repository for starting a new kata.
Prerequisites:
- JDK 17+
- latest version of Maven (3+)
- network access to Maven Central Repository
Start developing
Please run mvn install to install dojo dependencies (JUnit) and start working.
Preferred IDE is IntelliJ Idea.
From https://codingdojo.org/kata/cupcake/
This kata was originally made to implement the decorator and composite pattern.
Write a program that can build many cakes with many toppings like : βCupcake with chocolate and nutsβ Or βπ§ with black π« and π₯ and π¬β. Be carful the order of topping is very important.
Write a function or method that can show the name of cake.
Write a function that can show the price of cake. The price is composed of base cake price and topping price.
Now itβs possible to make a bundle of cakes. The price of a bundle is 10% less than prices of each cake.
Itβs possible to build a bundle of bundle with singles cakes.
In pseudocode to build a Cupcake with chocolate and nuts and sugar you will write
var myCake = Sugar(Nuts(Chocolate(Cupcake())))
With typing, we can start to test :
I can put a Cupcake in a variable of type Cake
- The name function should return βπ§β
- The name function should return βπͺβ
- The name function should return βπ§ with π«β
- The name function should return βπͺ with π«β
- The name function should return βπͺ with π« and π₯β
- The name function should return βπͺ with π₯ and π«β
- The price function should return 1$ for βπ§β
- The price function should return 2$ for βπͺβ
- The price function should return 1.1$ for βπ§ with π«β
- The price function should return 2.1$ for βπͺ with π«β
- The price function should return 2.2$ for βπͺ with π₯β
- We can build a Bundle with 1 Cupcake and check price or description
- We can build a Bundle with 1 Cupcake and 1 Cookie and check price or description
- We can build a Bundle with 2 Cupcake and 1 Cookie and check price or description
- We can build a bundle with 1 bundle of 2 cakes and 1 Cupcake and check price or description
- We can build a bundle with many bundle of bundle and many cakes and check price or description