From 9c56f1020fa44e54ff1b8b557092214e73d3298c Mon Sep 17 00:00:00 2001 From: Otabiel Date: Fri, 26 Feb 2021 15:02:29 +0100 Subject: [PATCH 1/4] =?UTF-8?q?Ajout=20de=20deux=20bi=C3=A8res=20et=20de?= =?UTF-8?q?=20leurs=20tests;=20Swaf=20et=20Eve=20Litchi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/chill/domain/Otabiel/Eve_Litchi.java | 17 +++++++++++ .../heigvd/res/chill/domain/Otabiel/Swaf.java | 17 +++++++++++ .../chill/domain/Otabiel/Eve_LitchiTest.java | 30 +++++++++++++++++++ .../res/chill/domain/Otabiel/SwafTest.java | 30 +++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java create mode 100644 src/main/java/ch/heigvd/res/chill/domain/Otabiel/Swaf.java create mode 100644 src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java create mode 100644 src/test/java/ch/heigvd/res/chill/domain/Otabiel/SwafTest.java diff --git a/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java b/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java new file mode 100644 index 00000000..18fafa03 --- /dev/null +++ b/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java @@ -0,0 +1,17 @@ +package ch.heigvd.res.chill.domain.Otabiel; + +import ch.heigvd.res.chill.domain.IProduct; + +import java.math.BigDecimal; + +public class Eve_Litchi implements IProduct { + public final static String NAME = "Eve Litchi"; + public final static BigDecimal PRICE = new BigDecimal(2.5); + + @Override + public String getName() {return NAME;} + + @Override + public BigDecimal getPrice() {return PRICE;} + +} diff --git a/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Swaf.java b/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Swaf.java new file mode 100644 index 00000000..1201ae00 --- /dev/null +++ b/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Swaf.java @@ -0,0 +1,17 @@ +package ch.heigvd.res.chill.domain.Otabiel; + +import ch.heigvd.res.chill.domain.IProduct; + +import java.math.BigDecimal; + +public class Swaf implements IProduct { + public final static String NAME = "Swaf"; + public final static BigDecimal PRICE = new BigDecimal(2.0); + + @Override + public String getName() {return NAME;} + + @Override + public BigDecimal getPrice() {return PRICE;} + +} \ No newline at end of file diff --git a/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java new file mode 100644 index 00000000..d8e7701c --- /dev/null +++ b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java @@ -0,0 +1,30 @@ +package ch.heigvd.res.chill.domain.Otabiel; + +import ch.heigvd.res.chill.domain.Bartender; +import ch.heigvd.res.chill.protocol.OrderRequest; +import ch.heigvd.res.chill.protocol.OrderResponse; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class Eve_LitchiTest { + + @Test + void thePriceAndNameForBoxerShouldBeCorrect() { + Eve_Litchi beer = new Eve_Litchi(); + assertEquals(beer.getName(), Eve_Litchi.NAME); + assertEquals(beer.getPrice(), Eve_Litchi.PRICE); + } + + @Test + void aBartenderShouldAcceptAnOrderForBoxer() { + Bartender jane = new Bartender(); + String productName = "ch.heigvd.res.chill.domain.wasadigi.Boxer"; + OrderRequest request = new OrderRequest(3, productName); + OrderResponse response = jane.order(request); + BigDecimal expectedTotalPrice = Eve_Litchi.PRICE.multiply(new BigDecimal(3)); + assertEquals(expectedTotalPrice, response.getTotalPrice()); + } +} \ No newline at end of file diff --git a/src/test/java/ch/heigvd/res/chill/domain/Otabiel/SwafTest.java b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/SwafTest.java new file mode 100644 index 00000000..ecb68b16 --- /dev/null +++ b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/SwafTest.java @@ -0,0 +1,30 @@ +package ch.heigvd.res.chill.domain.Otabiel; + +import ch.heigvd.res.chill.domain.Bartender; +import ch.heigvd.res.chill.protocol.OrderRequest; +import ch.heigvd.res.chill.protocol.OrderResponse; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class SwafTest { + + @Test + void thePriceAndNameForBoxerShouldBeCorrect() { + Swaf beer = new Swaf(); + assertEquals(beer.getName(), Swaf.NAME); + assertEquals(beer.getPrice(), Swaf.PRICE); + } + + @Test + void aBartenderShouldAcceptAnOrderForBoxer() { + Bartender jane = new Bartender(); + String productName = "ch.heigvd.res.chill.domain.wasadigi.Boxer"; + OrderRequest request = new OrderRequest(3, productName); + OrderResponse response = jane.order(request); + BigDecimal expectedTotalPrice = Swaf.PRICE.multiply(new BigDecimal(3)); + assertEquals(expectedTotalPrice, response.getTotalPrice()); + } +} \ No newline at end of file From 1452b4d95c8916e43ce2b74a9907ae428174dbeb Mon Sep 17 00:00:00 2001 From: Otabiel Date: Fri, 26 Feb 2021 15:12:45 +0100 Subject: [PATCH 2/4] Modification des fichiers test --- .../ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java | 6 +++--- .../java/ch/heigvd/res/chill/domain/Otabiel/SwafTest.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java index d8e7701c..83d40a6b 100644 --- a/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java +++ b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java @@ -12,16 +12,16 @@ class Eve_LitchiTest { @Test - void thePriceAndNameForBoxerShouldBeCorrect() { + void thePriceAndNameForEve_LitchiShouldBeCorrect() { Eve_Litchi beer = new Eve_Litchi(); assertEquals(beer.getName(), Eve_Litchi.NAME); assertEquals(beer.getPrice(), Eve_Litchi.PRICE); } @Test - void aBartenderShouldAcceptAnOrderForBoxer() { + void aBartenderShouldAcceptAnOrderForEve_Litchi() { Bartender jane = new Bartender(); - String productName = "ch.heigvd.res.chill.domain.wasadigi.Boxer"; + String productName = "ch.heigvd.res.chill.domain.Otabiel.Eve_Litchi"; OrderRequest request = new OrderRequest(3, productName); OrderResponse response = jane.order(request); BigDecimal expectedTotalPrice = Eve_Litchi.PRICE.multiply(new BigDecimal(3)); diff --git a/src/test/java/ch/heigvd/res/chill/domain/Otabiel/SwafTest.java b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/SwafTest.java index ecb68b16..d560ca7e 100644 --- a/src/test/java/ch/heigvd/res/chill/domain/Otabiel/SwafTest.java +++ b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/SwafTest.java @@ -12,16 +12,16 @@ class SwafTest { @Test - void thePriceAndNameForBoxerShouldBeCorrect() { + void thePriceAndNameForSwafShouldBeCorrect() { Swaf beer = new Swaf(); assertEquals(beer.getName(), Swaf.NAME); assertEquals(beer.getPrice(), Swaf.PRICE); } @Test - void aBartenderShouldAcceptAnOrderForBoxer() { + void aBartenderShouldAcceptAnOrderForSwaf() { Bartender jane = new Bartender(); - String productName = "ch.heigvd.res.chill.domain.wasadigi.Boxer"; + String productName = "ch.heigvd.res.chill.domain.Otabiel.Swaf"; OrderRequest request = new OrderRequest(3, productName); OrderResponse response = jane.order(request); BigDecimal expectedTotalPrice = Swaf.PRICE.multiply(new BigDecimal(3)); From b7202cfed87af79791a331407ee45c6099bd837d Mon Sep 17 00:00:00 2001 From: Otabiel Date: Thu, 4 Mar 2021 09:25:34 +0100 Subject: [PATCH 3/4] Suppresion et ajout d'une nouvelle branche --- .../res/chill/domain/Otabiel/Eve_Litchi.java | 17 ----------- .../chill/domain/Otabiel/Eve_LitchiTest.java | 30 ------------------- 2 files changed, 47 deletions(-) delete mode 100644 src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java delete mode 100644 src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java diff --git a/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java b/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java deleted file mode 100644 index 18fafa03..00000000 --- a/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java +++ /dev/null @@ -1,17 +0,0 @@ -package ch.heigvd.res.chill.domain.Otabiel; - -import ch.heigvd.res.chill.domain.IProduct; - -import java.math.BigDecimal; - -public class Eve_Litchi implements IProduct { - public final static String NAME = "Eve Litchi"; - public final static BigDecimal PRICE = new BigDecimal(2.5); - - @Override - public String getName() {return NAME;} - - @Override - public BigDecimal getPrice() {return PRICE;} - -} diff --git a/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java deleted file mode 100644 index 83d40a6b..00000000 --- a/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package ch.heigvd.res.chill.domain.Otabiel; - -import ch.heigvd.res.chill.domain.Bartender; -import ch.heigvd.res.chill.protocol.OrderRequest; -import ch.heigvd.res.chill.protocol.OrderResponse; -import org.junit.jupiter.api.Test; - -import java.math.BigDecimal; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -class Eve_LitchiTest { - - @Test - void thePriceAndNameForEve_LitchiShouldBeCorrect() { - Eve_Litchi beer = new Eve_Litchi(); - assertEquals(beer.getName(), Eve_Litchi.NAME); - assertEquals(beer.getPrice(), Eve_Litchi.PRICE); - } - - @Test - void aBartenderShouldAcceptAnOrderForEve_Litchi() { - Bartender jane = new Bartender(); - String productName = "ch.heigvd.res.chill.domain.Otabiel.Eve_Litchi"; - OrderRequest request = new OrderRequest(3, productName); - OrderResponse response = jane.order(request); - BigDecimal expectedTotalPrice = Eve_Litchi.PRICE.multiply(new BigDecimal(3)); - assertEquals(expectedTotalPrice, response.getTotalPrice()); - } -} \ No newline at end of file From eb2dc47772740a7088aa91fff28ba26f85c57066 Mon Sep 17 00:00:00 2001 From: Otabiel Date: Thu, 4 Mar 2021 09:28:20 +0100 Subject: [PATCH 4/4] =?UTF-8?q?Ajout=20branche=20deuxi=C3=A8me=20bi=C3=A8r?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/chill/domain/Otabiel/Eve_Litchi.java | 17 +++++++++++ .../chill/domain/Otabiel/Eve_LitchiTest.java | 30 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java create mode 100644 src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java diff --git a/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java b/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java new file mode 100644 index 00000000..18fafa03 --- /dev/null +++ b/src/main/java/ch/heigvd/res/chill/domain/Otabiel/Eve_Litchi.java @@ -0,0 +1,17 @@ +package ch.heigvd.res.chill.domain.Otabiel; + +import ch.heigvd.res.chill.domain.IProduct; + +import java.math.BigDecimal; + +public class Eve_Litchi implements IProduct { + public final static String NAME = "Eve Litchi"; + public final static BigDecimal PRICE = new BigDecimal(2.5); + + @Override + public String getName() {return NAME;} + + @Override + public BigDecimal getPrice() {return PRICE;} + +} diff --git a/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java new file mode 100644 index 00000000..83d40a6b --- /dev/null +++ b/src/test/java/ch/heigvd/res/chill/domain/Otabiel/Eve_LitchiTest.java @@ -0,0 +1,30 @@ +package ch.heigvd.res.chill.domain.Otabiel; + +import ch.heigvd.res.chill.domain.Bartender; +import ch.heigvd.res.chill.protocol.OrderRequest; +import ch.heigvd.res.chill.protocol.OrderResponse; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class Eve_LitchiTest { + + @Test + void thePriceAndNameForEve_LitchiShouldBeCorrect() { + Eve_Litchi beer = new Eve_Litchi(); + assertEquals(beer.getName(), Eve_Litchi.NAME); + assertEquals(beer.getPrice(), Eve_Litchi.PRICE); + } + + @Test + void aBartenderShouldAcceptAnOrderForEve_Litchi() { + Bartender jane = new Bartender(); + String productName = "ch.heigvd.res.chill.domain.Otabiel.Eve_Litchi"; + OrderRequest request = new OrderRequest(3, productName); + OrderResponse response = jane.order(request); + BigDecimal expectedTotalPrice = Eve_Litchi.PRICE.multiply(new BigDecimal(3)); + assertEquals(expectedTotalPrice, response.getTotalPrice()); + } +} \ No newline at end of file