diff --git a/src/main/java/de/hsfulda/onses/models/Cards.java b/src/main/java/de/hsfulda/onses/models/Cards.java index 59e5da4..e96f8f6 100644 --- a/src/main/java/de/hsfulda/onses/models/Cards.java +++ b/src/main/java/de/hsfulda/onses/models/Cards.java @@ -20,8 +20,21 @@ public class Cards { } }; - private int id; - private ecolor color; - private evalue value; + private final int id; + private final ecolor color; + private final evalue value; + + + public Cards(int id, ecolor color, evalue value) + { + this.id = id; + this.color = color; + this.value = value; + } + + + public int getId() { + return this.id; + } } diff --git a/src/test/java/de/hsfulda/onses/CardsTest.java b/src/test/java/de/hsfulda/onses/CardsTest.java new file mode 100644 index 0000000..d1d7daa --- /dev/null +++ b/src/test/java/de/hsfulda/onses/CardsTest.java @@ -0,0 +1,28 @@ + +package de.hsfulda.onses; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +import de.hsfulda.onses.models.Cards; + +public class CardsTest { + + @Test + @DisplayName("ModelCardsClass") + public void CardTestGetID5() { + + Cards testcard = new Cards(5, Cards.ecolor.BLACK, Cards.evalue.FIVE); + assertEquals(5, testcard.getId()); + } + @Test + @DisplayName("ModelCardsClass") + public void CardTestGetID112() { + + Cards testcard = new Cards(112, Cards.ecolor.BLUE, Cards.evalue.CHOOSEDRAW); + assertEquals(112, testcard.getId()); + } + + +} \ No newline at end of file