From 826619b147af1205f4981c4ca857e5ed729d8d5d Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Fri, 19 Jan 2024 14:36:24 +0100 Subject: [PATCH] Test.CardsGetColor --- .../java/de/hsfulda/onses/models/Cards.java | 4 ++++ src/test/java/de/hsfulda/onses/CardsTest.java | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/hsfulda/onses/models/Cards.java b/src/main/java/de/hsfulda/onses/models/Cards.java index e96f8f6..0326c85 100644 --- a/src/main/java/de/hsfulda/onses/models/Cards.java +++ b/src/main/java/de/hsfulda/onses/models/Cards.java @@ -37,4 +37,8 @@ public class Cards { return this.id; } + public ecolor getColor() { + return this.color; + } + } diff --git a/src/test/java/de/hsfulda/onses/CardsTest.java b/src/test/java/de/hsfulda/onses/CardsTest.java index d1d7daa..4eb4bcf 100644 --- a/src/test/java/de/hsfulda/onses/CardsTest.java +++ b/src/test/java/de/hsfulda/onses/CardsTest.java @@ -10,19 +10,34 @@ import de.hsfulda.onses.models.Cards; public class CardsTest { @Test - @DisplayName("ModelCardsClass") + @DisplayName("CardGetID5") public void CardTestGetID5() { Cards testcard = new Cards(5, Cards.ecolor.BLACK, Cards.evalue.FIVE); assertEquals(5, testcard.getId()); } @Test - @DisplayName("ModelCardsClass") + @DisplayName("CardGetID112") public void CardTestGetID112() { Cards testcard = new Cards(112, Cards.ecolor.BLUE, Cards.evalue.CHOOSEDRAW); assertEquals(112, testcard.getId()); } + @Test + @DisplayName("CardGetColorBlue") + public void CardTestGetColorBlue() { + + Cards testcard = new Cards(9, Cards.ecolor.BLUE, Cards.evalue.FIVE); + assertEquals(Cards.ecolor.BLUE, testcard.getColor()); + } + @Test + @DisplayName("CardGetColorBlack") + public void CardTestGetColorBlack() { + + Cards testcard = new Cards(15, Cards.ecolor.BLACK, Cards.evalue.CHOOSE); + assertEquals(Cards.ecolor.BLACK, testcard.getColor()); + } + } \ No newline at end of file