Commit 47116e10 authored by Killian LUCAS's avatar Killian LUCAS
Browse files

GameTest.java update

parent f68cd501
......@@ -3,6 +3,7 @@ package fr.univnantes.alma.server.game;
import fr.univnantes.alma.data.DatabaseFactory;
import fr.univnantes.alma.common.NotAloneDatabase;
import fr.univnantes.alma.server.game.item.Phase;
import fr.univnantes.alma.server.game.item.Reserve;
import fr.univnantes.alma.server.game.item.action.ActionChoosePower;
import fr.univnantes.alma.server.game.item.board.Board;
import fr.univnantes.alma.server.game.item.board.BoardColor;
......@@ -146,7 +147,7 @@ public class GameTest {
@Test
public void testGamePair_ErrorSup7(){
Room room = mock(Room.class);
ArrayList a = new ArrayList();
List<Pair<Integer, String>> a = new ArrayList();
a.add(new Pair(1,"Natan"));
a.add(new Pair(2,"Odile"));
a.add(new Pair(3,"Tom tom"));
......@@ -155,7 +156,7 @@ public class GameTest {
a.add(new Pair(6,"Oriane"));
a.add(new Pair(7,"Nana"));
a.add(new Pair(8,"Emilie"));
assertThrows(IllegalArgumentException.class,()-> new Game((List<Pair<Integer, String>>) a, 1, planet, board, room));
assertThrows(IllegalArgumentException.class,()-> new Game( a, 1, planet, board, room));
}
@Test
public void testGamePair_ErrorEmpty(){
......@@ -165,20 +166,20 @@ public class GameTest {
@Test
public void testGamePair_ErrorIdCreature(){
Room room = mock(Room.class);
ArrayList a = new ArrayList();
List<Pair<Integer, String>> a = new ArrayList();
a.add(new Pair(1,"Natan"));
a.add(new Pair(2,"Odile"));
assertThrows(IllegalArgumentException.class,()-> new Game((List<Pair<Integer, String>>) a, 3, planet, board, room));
assertThrows(IllegalArgumentException.class,()-> new Game( a, 3, planet, board, room));
}
@Test
void testGamePair() throws TException {
Room room = mock(Room.class);
ArrayList a = new ArrayList();
a.add(new Pair(1,"Natan"));
a.add(new Pair(2,"Odile"));
Game game = new Game((List<Pair<Integer, String>>) a, 1, planet, board, room);
List<Pair<Integer, String>> a = new ArrayList(Arrays.asList(new Pair(1,"Natan"),new Pair(2,"Odile")));
Game game = new Game( a, 1, planet, board, room);
game.getPlanet().forceMovePlanetPawn();
Board board = game.getBoard();
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);
......
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