Browse Source

Test.CardsGetID

main
fdai7920 11 months ago
parent
commit
7fbeacc0aa
  1. 19
      src/main/java/de/hsfulda/onses/models/Cards.java
  2. 28
      src/test/java/de/hsfulda/onses/CardsTest.java

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

28
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());
}
}
Loading…
Cancel
Save