diff --git a/src/main/java/ch/heigvd/res/pizza/domain/kevindovale/Boisee.java b/src/main/java/ch/heigvd/res/pizza/domain/kevindovale/Boisee.java new file mode 100644 index 0000000..66158aa --- /dev/null +++ b/src/main/java/ch/heigvd/res/pizza/domain/kevindovale/Boisee.java @@ -0,0 +1,20 @@ +package ch.heigvd.res.pizza.domain.kevindovale; + +import ch.heigvd.res.pizza.domain.IProduct; + +import java.math.BigDecimal; + +public class Boisee implements IProduct { + + public final static String NAME = "Boisee Pizza"; + public final static BigDecimal PRICE = new BigDecimal(20); + + public String getName() { + return NAME; + } + + public BigDecimal getPrice(){ + return PRICE; + } +} + diff --git a/src/test/java/ch/heigvd/res/pizza/domain/kevindovale/BoiseeTest.java b/src/test/java/ch/heigvd/res/pizza/domain/kevindovale/BoiseeTest.java new file mode 100644 index 0000000..eb00275 --- /dev/null +++ b/src/test/java/ch/heigvd/res/pizza/domain/kevindovale/BoiseeTest.java @@ -0,0 +1,31 @@ +package ch.heigvd.res.pizza.domain.kevindovale; + +import ch.heigvd.res.pizza.domain.Pizzaiolo; +import ch.heigvd.res.pizza.protocol.OrderRequest; +import ch.heigvd.res.pizza.protocol.OrderResponse; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; + +import static org.junit.jupiter.api.Assertions.*; + +class BoiseeTest { + + @Test + void thePriceAndNameForBoiseeShouldBeCorrect() { + Boisee pizza = new Boisee(); + assertEquals(pizza.getName(), Boisee.NAME); + assertEquals(pizza.getPrice(), Boisee.PRICE); + } + + @Test + void aPizzaioloShouldAcceptAnOrderForBoisee() { + Pizzaiolo mario = new Pizzaiolo(); + String productName = "ch.heigvd.res.pizza.domain.kevindovale.Boisee"; + int numberOfPizzas = 2; + OrderRequest request = new OrderRequest(numberOfPizzas, productName); + OrderResponse response = mario.order(request); + BigDecimal expectedTotalPrice = Boisee.PRICE.multiply(new BigDecimal(numberOfPizzas)); + assertEquals(expectedTotalPrice, response.getTotalPrice()); + } +} \ No newline at end of file