Browse Source

Test.CardsGetColor

main
fdai7920 12 months ago
parent
commit
826619b147
  1. 4
      src/main/java/de/hsfulda/onses/models/Cards.java
  2. 19
      src/test/java/de/hsfulda/onses/CardsTest.java

4
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;
}
}

19
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());
}
}
|||||||
100:0
Loading…
Cancel
Save