Commit 1862ad5f authored by Killian LUCAS's avatar Killian LUCAS
Browse files

GameTest.java update

parent 5bc545ad
......@@ -148,7 +148,7 @@ public class GameTest {
public void testGamePair_ErrorSup7(){
Room room = mock(Room.class);
List<Pair<Integer, String>> a = new ArrayList();
a.add(new Pair(1,"Natan"));
a.add(new Pair(1,"Nathan"));
a.add(new Pair(2,"Odile"));
a.add(new Pair(3,"Tom tom"));
a.add(new Pair(4,"Alban"));
......@@ -167,14 +167,14 @@ public class GameTest {
public void testGamePair_ErrorIdCreature(){
Room room = mock(Room.class);
List<Pair<Integer, String>> a = new ArrayList();
a.add(new Pair(1,"Natan"));
a.add(new Pair(1,"Nathan"));
a.add(new Pair(2,"Odile"));
assertThrows(IllegalArgumentException.class,()-> new Game( a, 3, planet, board, room));
}
@Test
void testGamePair() throws TException {
Room room = mock(Room.class);
List<Pair<Integer, String>> a = new ArrayList(Arrays.asList(new Pair(1,"Natan"),new Pair(2,"Odile")));
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();
Board board = game.getBoard();
......@@ -186,21 +186,26 @@ public class GameTest {
game.enableJetonArtemia();
assertTrue(game.isJetonArtemiaIsActive());
// verification creature
assertEquals(game.getCreature().getInGameId(), 1);
assertEquals(1,game.getCreature().getInGameId());
// verification traque
assertEquals(game.getTraques().get(0).getName(), "Odile");
assertEquals("Odile",game.getTraques().get(0).getName());
//verifcation getPlayerMap
assertEquals( 2,game.getPlayersMap().size());
//verifcation getPlayer
assertEquals("Player1",game.getPlayer(1).getName());
//verification reserve
assertEquals(new Reserve(new ArrayList<PlaceCard>(Arrays.asList(marais,abri,epave,source,artefact)),2).getPlaceCards(),game.getReserve().getPlaceCards());
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);
assertTrue(game.playerHasFinished(1, Phase.PREPHASE_1).state);
assertTrue(game.playerHasFinished(2, Phase.PREPHASE_1).state);
assertEquals(game.getState(), Phase.PHASE_1);
assertTrue(game.playerHasFinished(1, Phase.PHASE_1).state);
assertFalse(game.playerHasFinished(2, Phase.PHASE_1).state);
assertTrue(game.playerPlayCard(2, Collections.singletonList(plage)).state);
......
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