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 { ...@@ -239,6 +239,7 @@ class GameTest {
} }
@Test @Test
void testTraqueCanPickSurvivalCards() { void testTraqueCanPickSurvivalCards() {
Room room = mock(Room.class); Room room = mock(Room.class);
...@@ -309,7 +310,7 @@ class GameTest { ...@@ -309,7 +310,7 @@ class GameTest {
} }
@Test @Test
void testPlayerResist_phase2() { void testPlayerResist_falsePhase2() {
Room room = mock(Room.class); Room room = mock(Room.class);
List<Pair<Integer, String>> list = new ArrayList<>(Arrays.asList(new Pair<>(1, "Nathan"), new Pair<>(2, "Odile"))); 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 game = new Game(list, 1, planet, board, room);
...@@ -327,6 +328,44 @@ class GameTest { ...@@ -327,6 +328,44 @@ class GameTest {
assertEquals(response, game.playerResist(2, 2)); assertEquals(response, game.playerResist(2, 2));
} }
@Test @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() { void testPlayerResist_true() {
Room room = mock(Room.class); Room room = mock(Room.class);
List<Pair<Integer, String>> list = new ArrayList<>(Arrays.asList(new Pair<>(1, "Nathan"), new Pair<>(2, "Odile"))); List<Pair<Integer, String>> list = new ArrayList<>(Arrays.asList(new Pair<>(1, "Nathan"), new Pair<>(2, "Odile")));
...@@ -673,12 +712,6 @@ class GameTest { ...@@ -673,12 +712,6 @@ class GameTest {
game.creaturePlayTrackingCard(game.getCreature(),mutation); game.creaturePlayTrackingCard(game.getCreature(),mutation);
// assertFalse(game.creatureCanPlayThisTrackingCards(game.getCreature(), Arrays.asList(acharnement, mutation)));
} }
@Test @Test
void testGetIdPlayerTargetByTrackingCardAnticipation() throws TException { void testGetIdPlayerTargetByTrackingCardAnticipation() throws TException {
......
Supports Markdown
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