From 7e750cd942065136bdc139cd321e776c16db822b Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Fri, 19 Jan 2024 14:44:55 +0100 Subject: [PATCH] Test.CardsGetValue --- src/main/java/de/hsfulda/onses/models/Cards.java | 3 +++ src/test/java/de/hsfulda/onses/CardsTest.java | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/main/java/de/hsfulda/onses/models/Cards.java b/src/main/java/de/hsfulda/onses/models/Cards.java index 0326c85..d2aeb30 100644 --- a/src/main/java/de/hsfulda/onses/models/Cards.java +++ b/src/main/java/de/hsfulda/onses/models/Cards.java @@ -41,4 +41,7 @@ public class Cards { return this.color; } + public evalue getValue() { + return this.value; + } } diff --git a/src/test/java/de/hsfulda/onses/CardsTest.java b/src/test/java/de/hsfulda/onses/CardsTest.java index 4eb4bcf..eb133a2 100644 --- a/src/test/java/de/hsfulda/onses/CardsTest.java +++ b/src/test/java/de/hsfulda/onses/CardsTest.java @@ -24,6 +24,7 @@ public class CardsTest { assertEquals(112, testcard.getId()); } + @Test @DisplayName("CardGetColorBlue") public void CardTestGetColorBlue() { @@ -40,4 +41,19 @@ public class CardsTest { } + @Test + @DisplayName("CardGetValueThree") + public void CardTestGetValueThree() { + + Cards testcard = new Cards(2, Cards.ecolor.BLUE, Cards.evalue.THREE); + assertEquals(Cards.evalue.THREE, testcard.getValue()); + } + @Test + @DisplayName("CardGetValueSkip") + public void CardTestGetValueSkip() { + + Cards testcard = new Cards(19, Cards.ecolor.BLACK, Cards.evalue.SKIP); + assertEquals(Cards.evalue.SKIP, testcard.getValue()); + } + } \ No newline at end of file