Commit 220f0e9c authored by Killian LUCAS's avatar Killian LUCAS
Browse files

GameTest.java ajout de test

parent af6b5e36
......@@ -6,6 +6,7 @@ import fr.univnantes.alma.server.game.item.Phase;
import fr.univnantes.alma.server.game.item.Reserve;
import fr.univnantes.alma.server.game.item.action.Action;
import fr.univnantes.alma.server.game.item.action.ActionChoosePower;
import fr.univnantes.alma.server.game.item.action.ActionMovePlayer;
import fr.univnantes.alma.server.game.item.action.ActionTargetPlayer;
import fr.univnantes.alma.server.game.item.board.Board;
import fr.univnantes.alma.server.game.item.board.BoardColor;
......@@ -780,6 +781,7 @@ class GameTest {
assertTrue(game.playerHasFinished(1, Phase.PREPHASE_3).state);
assertTrue(game.playerHasFinished(2, Phase.PREPHASE_3).state);
///
assertTrue(game.playerHasFinished(1, Phase.PHASE_3).state);
assertTrue(game.playerHasFinished(2, Phase.PHASE_3).state);
......@@ -792,65 +794,46 @@ class GameTest {
assertTrue(game.playerHasFinished(1, Phase.PHASE_4).state);
assertTrue(game.playerHasFinished(2, Phase.PHASE_4).state);
assertTrue(game.playerHasFinished(1, Phase.POSTPHASE_4).state);
assertTrue(game.playerHasFinished(2, Phase.POSTPHASE_4).state);
assertTrue(game.isFinish());
}
}
/*Pour moi playerResist
@Test
void testGamePair() throws TException {
@Test
void testMovePlayer() throws TException {
Room room = mock(Room.class);
List<Pair<Integer, String>> a = new ArrayList(Arrays.asList(new Pair(1,"Nathan"),new Pair(2,"Odile")));
Game game = new Game( a, 1, planet, board, room);
game.getPlanet().forceMovePlanetPawn();
Game game = new Game(Arrays.asList(1, 2), 1, planet, board, room);
Board board = game.getBoard();
game.getTraques().get(0).getSurvivalCardsHand().clear();
game.getTraques().get(0).getSurvivalCardsHand().add(retraite);
assertEquals(new Score(7,13), board.getScore());
board.moveForwardTraque(11);
board.moveForwardCreature(6);
assertEquals(new Score(1,2), board.getScore());
when(room.askAction(any(Integer.class), any(TAskAction.class)))
.thenReturn(new ActionChoosePower(0));
assertEquals(game.getState(), Phase.PREPHASE_1);
.thenReturn(new ActionMovePlayer(2, Place.PLACE_THREE));
assertEquals(Phase.PREPHASE_1,game.getState());
assertTrue(game.playerHasFinished(1, Phase.PREPHASE_1).state);
assertTrue(game.playerHasFinished(2, Phase.PREPHASE_1).state);
assertTrue(game.playerHasFinished(1, Phase.PHASE_1).state);
assertFalse(game.playerHasFinished(2, Phase.PHASE_1).state);
assertTrue(game.playerPlayCard(2, Collections.singletonList(plage)).state);
assertTrue(game.playerHasFinished(2, Phase.PHASE_1).state);
assertTrue(game.playerHasFinished(1, Phase.POSTPHASE_1).state);
assertTrue(game.playerHasFinished(2, Phase.POSTPHASE_1).state);
assertTrue(game.playerHasFinished(1, Phase.PREPHASE_2).state);
assertTrue(game.playerHasFinished(2, Phase.PREPHASE_2).state);
assertFalse(game.playerHasFinished(1, Phase.PHASE_2).state);
assertTrue(game.playerPlaceJeton(1, Collections.singletonList(new PlacedJeton(JetonSymbol.CREATURE, Collections.singletonList(Place.PLACE_ONE)))).state);
assertTrue(game.playerHasFinished(1, Phase.PHASE_2).state);
assertTrue(game.playerHasFinished(2, Phase.PHASE_2).state);
assertTrue(game.playerHasFinished(1, Phase.POSTPHASE_2).state);
assertTrue(game.playerHasFinished(2, Phase.POSTPHASE_2).state);
assertTrue(game.playerHasFinished(1, Phase.PREPHASE_3).state);
assertTrue(game.playerHasFinished(2, Phase.PREPHASE_3).state);
assertTrue(game.playerHasFinished(1, Phase.PHASE_3).state);
assertTrue(game.playerHasFinished(2, Phase.PHASE_3).state);
assertTrue(game.playerHasFinished(1, Phase.POSTPHASE_3).state);
assertTrue(game.playerHasFinished(2, Phase.POSTPHASE_3).state);
assertTrue(game.playerHasFinished(1, Phase.PREPHASE_4).state);
assertTrue(game.playerHasFinished(2, Phase.PREPHASE_4).state);
assertTrue(game.playerHasFinished(1, Phase.PHASE_4).state);
assertTrue(game.playerHasFinished(2, Phase.PHASE_4).state);
assertTrue(game.playerHasFinished(1, Phase.POSTPHASE_4).state);
assertTrue(game.playerHasFinished(2, Phase.POSTPHASE_4).state);
Response response = new Response(true, "");
assertEquals(response, game.traquePlaySurvivalCard(game.getTraques().get(0), retraite));
Pair<Integer, Place> response1 = new Pair<Integer, Place>(2, Place.PLACE_THREE );
assertEquals(response1,game.movePlayer(2));
assertTrue(game.isFinish());
}
*/
}
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