Commit 7886e8ec authored by Killian LUCAS's avatar Killian LUCAS
Browse files

GameTest.java ajout de test

parent 4758f342
......@@ -239,6 +239,7 @@ class GameTest {
}
@Test
void testTraqueCanPickSurvivalCards() {
Room room = mock(Room.class);
......@@ -309,7 +310,7 @@ class GameTest {
}
@Test
void testPlayerResist_phase2() {
void testPlayerResist_falsePhase2() {
Room room = mock(Room.class);
List<Pair<Integer, String>> list = new ArrayList<>(Arrays.asList(new Pair<>(1, "Nathan"), new Pair<>(2, "Odile")));
Game game = new Game(list, 1, planet, board, room);
......@@ -327,6 +328,44 @@ class GameTest {
assertEquals(response, game.playerResist(2, 2));
}
@Test
void testPlayerResist_falseCreature() {
Room room = mock(Room.class);
List<Pair<Integer, String>> list = new ArrayList<>(Arrays.asList(new Pair<>(1, "Nathan"), new Pair<>(2, "Odile")));
Game game = new Game(list, 1, planet, board, room);
//Start phase 1
game.startNextPhase();
Response response = new Response(false, "Only traque can resist");
assertEquals(response, game.playerResist(1, 2));
}
@Test
void testPlayerResist_falseCantResistThisRound() {
Room room = mock(Room.class);
List<Pair<Integer, String>> list = new ArrayList<>(Arrays.asList(new Pair<>(1, "Nathan"), new Pair<>(2, "Odile")));
Game game = new Game(list, 1, planet, board, room);
game.getCreature().getTrackingCardHand().clear();
game.getCreature().getTrackingCardHand().add(angoisse);
Response response = new Response(true, "");
assertTrue(game.creatureCanPlayThisTrackingCards(game.getCreature(), angoisse));
assertEquals(response, game.creaturePlayTrackingCard(game.getCreature(),angoisse));
game.startNextPhase();
Response response2 = new Response(false, "You can't resist for this round");
assertEquals(response2, game.playerResist(2, 2));
}
@Test
void testPlayerResist_false() {
Room room = mock(Room.class);
List<Pair<Integer, String>> list = new ArrayList<>(Arrays.asList(new Pair<>(1, "Nathan"), new Pair<>(2, "Odile")));
Game game = new Game(list, 1, planet, board, room);
//Start phase 1
game.startNextPhase();
game.getTraques().get(0).setCanResist(false);
Response response = new Response(false, "You can't resist");
assertEquals(response, game.playerResist(2, 2));
}
@Test
void testPlayerResist_true() {
Room room = mock(Room.class);
List<Pair<Integer, String>> list = new ArrayList<>(Arrays.asList(new Pair<>(1, "Nathan"), new Pair<>(2, "Odile")));
......@@ -673,12 +712,6 @@ class GameTest {
game.creaturePlayTrackingCard(game.getCreature(),mutation);
// assertFalse(game.creatureCanPlayThisTrackingCards(game.getCreature(), Arrays.asList(acharnement, mutation)));
}
@Test
void testGetIdPlayerTargetByTrackingCardAnticipation() throws TException {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment