Commit 52c6a880 authored by Thomas DENIS's avatar Thomas DENIS
Browse files

Merge remote-tracking branch 'origin/master'

parents 4c252752 000a01d9
......@@ -185,7 +185,7 @@ public class Game implements GameInterface {
this.playersMap.put(pair.getKey(), traque);
}
else {
this.creature = new Creature("Player" + creatureId, creatureId);
this.creature = new Creature(pair.getValue(), pair.getKey());
this.playersMap.put(creatureId, this.creature);
}
}
......@@ -815,7 +815,7 @@ public class Game implements GameInterface {
canPlay = false;
}
}
canPlay = canPlay && creature.getHand().trackingCardPlayedSize() + toPlay.size() > creature.getMaxTrackingCardPlayable();
canPlay = canPlay && creature.getHand().trackingCardPlayedSize() + toPlay.size() <= creature.getMaxTrackingCardPlayable();
return canPlay && creature.getTrackingCardHand().containsAll(toPlay);
}
......
......@@ -8,7 +8,7 @@ import javassist.NotFoundException;
import java.util.*;
public class Reserve {
private Map<Integer, Pair<PlaceCard, Integer>> placeCards;
private final Map<Integer, Pair<PlaceCard, Integer>> placeCards;
public Reserve(List<PlaceCard> cards, int playerNumber) {
placeCards = new HashMap<>();
......@@ -112,10 +112,40 @@ public class Reserve {
public void add(PlaceCard placeCard) {
int cardNumber = placeCard.getNumber();
if(cardNumber<= 5 && cardNumber > 10) {
if(cardNumber<= 5 || cardNumber > 10) {
throw new IllegalArgumentException("PlaceCard in reserve are place cards 6 to 10");
}
int number = placeCards.get(cardNumber).getValue() + 1;
placeCards.put(cardNumber, new Pair<>(placeCard, number));
}
@Override
public boolean equals(Object obj) {
if(obj == this){
return true;
}
if(obj == null || ! (obj instanceof Reserve)){
return false;
}
System.out.println("ok");
Reserve reserve = (Reserve) obj;
return placeCards.equals(reserve.getPlaceCards());
}
@Override
public String toString() {
String res = "Reserve(";
Iterator<Map.Entry<Integer, Pair<PlaceCard, Integer>>> iterator = placeCards.entrySet().iterator();
Map.Entry<Integer, Pair<PlaceCard, Integer>> aux;
while (iterator.hasNext()) {
aux = iterator.next();
res += aux.getValue().getKey() + "(" + aux.getValue().getValue() + ")";
if(iterator.hasNext()) {
res += ", ";
}
}
res += ")";
return res;
}
}
package fr.univnantes.alma.server.game;
import fr.univnantes.alma.data.DatabaseFactory;
import fr.univnantes.alma.common.NotAloneDatabase;
import fr.univnantes.alma.data.DatabaseFactory;
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;
......@@ -9,7 +9,6 @@ import fr.univnantes.alma.server.game.item.board.Board;
import fr.univnantes.alma.server.game.item.board.BoardColor;
import fr.univnantes.alma.server.game.item.board.BoardDistribution;
import fr.univnantes.alma.server.game.item.board.Score;
import fr.univnantes.alma.server.game.item.card.Card;
import fr.univnantes.alma.server.game.item.card.PlaceCard;
import fr.univnantes.alma.server.game.item.card.SurvivalCard;
import fr.univnantes.alma.server.game.item.card.TrackingCard;
......@@ -17,27 +16,25 @@ import fr.univnantes.alma.server.game.item.jeton.JetonSymbol;
import fr.univnantes.alma.server.game.item.jeton.PlacedJeton;
import fr.univnantes.alma.server.game.item.planet.Place;
import fr.univnantes.alma.server.game.item.planet.Planet;
import fr.univnantes.alma.server.game.item.player.Creature;
import fr.univnantes.alma.server.game.utilitary.Pair;
import fr.univnantes.alma.server.user.PlayerProxy;
import fr.univnantes.alma.server.user.User;
import fr.univnantes.alma.thrift.Response;
import fr.univnantes.alma.thrift.TAskAction;
import org.apache.thrift.TException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import javax.sound.midi.Track;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static fr.univnantes.alma.server.game.item.card.CardName.*;
import static fr.univnantes.alma.server.game.item.card.CardName.ARTEFACT;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class GameTest {
class GameTest {
NotAloneDatabase database = DatabaseFactory.getDatabase();
Planet planet;
......@@ -77,7 +74,7 @@ public class GameTest {
@BeforeEach
public void setUp() {
List<PlaceCard> placeCards = new ArrayList();
List<PlaceCard> placeCards = new ArrayList<>();
placeCards.add(database.findPlaceCard(ANTRE.toString()));
placeCards.add(database.findPlaceCard(JUNGLE.toString()));
placeCards.add(database.findPlaceCard(RIVIERE.toString()));
......@@ -93,472 +90,288 @@ public class GameTest {
}
@Test
public void testGameCollection_moreThan7Players() {
void testCreateGameConstructorCollection_moreThan7Players() {
Room room = mock(Room.class);
assertThrows(IllegalArgumentException.class, () -> new Game(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8), 1, planet, board, room));
List<Integer> list = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8));
assertThrows(IllegalArgumentException.class, () -> new Game(list, 1, planet, board, room));
}
@Test
public void testGameCollection_ErrorEmpty() {
void testCreateGameConstructorCollection_noPlayers() {
Room room = mock(Room.class);
assertThrows(IllegalArgumentException.class, () -> new Game((Collection<Integer>) new ArrayList(), 1, planet, board, room));
List<Integer> list = new ArrayList<>();
assertThrows(IllegalArgumentException.class, () -> new Game(list, 1, planet, board, room));
}
@Test
public void testGameCollection_ErrorIdCreature() {
void testCreateGameConstructorCollection_badIdCreature() {
Room room = mock(Room.class);
assertThrows(IllegalArgumentException.class, () -> new Game(Arrays.asList(1, 2), 3, planet, board, room));
List<Integer> list = new ArrayList<>(Arrays.asList(1, 2));
assertThrows(IllegalArgumentException.class, () -> new Game(list, 3, planet, board, room));
}
@Test
void testGameCollection() throws TException {
void testCreateGameConstructorPairList_moreThan7Players() {
Room room = mock(Room.class);
Game game = new Game(Arrays.asList(1, 2), 1, planet, board, room);
game.getPlanet().forceMovePlanetPawn();
Board board = game.getBoard();
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));
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);
assertTrue(game.isFinish());
List<Pair<Integer, String>> list = new ArrayList<>();
list.add(new Pair<>(1, "Nathan"));
list.add(new Pair<>(2, "Odile"));
list.add(new Pair<>(3, "Tom tom"));
list.add(new Pair<>(4, "Alban"));
list.add(new Pair<>(5, "Luna"));
list.add(new Pair<>(6, "Oriane"));
list.add(new Pair<>(7, "Nana"));
list.add(new Pair<>(8, "Emilie"));
assertThrows(IllegalArgumentException.class, () -> new Game(list, 1, planet, board, room));
}
@Test
public void testGamePair_ErrorSup7() {
void testCreateGameConstructorPairList_noPLayers() {
Room room = mock(Room.class);
List<Pair<Integer, String>> a = new ArrayList();
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"));
a.add(new Pair(5, "Luna"));
a.add(new Pair(6, "Oriane"));
a.add(new Pair(7, "Nana"));
a.add(new Pair(8, "Emilie"));
assertThrows(IllegalArgumentException.class, () -> new Game(a, 1, planet, board, room));
List<Pair<Integer, String>> list = new ArrayList<>();
assertThrows(IllegalArgumentException.class, () -> new Game(list, 1, planet, board, room));
}
@Test
public void testGamePair_ErrorEmpty() {
void testCreateGameConstructorPairList_badIdCreature() {
Room room = mock(Room.class);
assertThrows(IllegalArgumentException.class, () -> new Game((List<Pair<Integer, String>>) new ArrayList(), 1, planet, board, room));
List<Pair<Integer, String>> list = new ArrayList<>();
list.add(new Pair<>(1, "Nathan"));
list.add(new Pair<>(2, "Odile"));
assertThrows(IllegalArgumentException.class, () -> new Game(list, 3, planet, board, room));
}
@Test
public void testGamePair_ErrorIdCreature() {
Room room = mock(Room.class);
List<Pair<Integer, String>> a = new ArrayList();
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 {
void testEnableJetonArtemia() {
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();
Board board = game.getBoard();
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));
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);
assertTrue(game.isJetonArtemiaIsActive());
game.disableJetonArtemia();
game.enableJetonArtemia();
assertTrue(game.isJetonArtemiaIsActive());
}
@Test
void testEnableAndDisableJetonArtemia() throws TException {
void testDisableJetonArtemia() {
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();
Board board = game.getBoard();
// verification jetonArtemia
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);
assertTrue(game.isJetonArtemiaIsActive());
game.disableJetonArtemia();
assertFalse(game.isJetonArtemiaIsActive());
game.enableJetonArtemia();
assertTrue(game.isJetonArtemiaIsActive());
}
@Test
void testGetCreature() throws TException {
void testGetCreature() {
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();
Board board = game.getBoard();
// verification creature
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);
assertEquals(1, game.getCreature().getInGameId());
assertEquals("Nathan", game.getCreature().getName());
}
@Test
void testGetTraque() throws TException {
void testGetTraque() {
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();
Board board = game.getBoard();
// verification traque
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);
assertEquals(2, game.getTraques().get(0).getInGameId());
assertEquals("Odile", game.getTraques().get(0).getName());
}
@Test
void testGetPlayerMap() throws TException {
void testGetPlayerMap() {
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();
Board board = game.getBoard();
//verification getPlayerMap
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);
assertEquals(2, game.getPlayersMap().size());
}
@Test
void testGetPlayer() throws TException {
void testGetPlayer() {
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();
Board board = game.getBoard();
//verification getPlayer
assertEquals("Player1", game.getPlayer(1).getName());
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);
assertEquals("Nathan", game.getPlayer(1).getName());
}
@Test
void testGetRoom() throws TException {
void testGetRoom() {
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();
Board board = game.getBoard();
//verification room
assertSame(game.getRoom(), game.getRoom());
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);
assertSame(room, game.getRoom());
}
@Test
void testGetReserve() throws TException {
void testGetReserve() {
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();
Board board = game.getBoard();
//verification reserve
assertEquals(new Reserve(new ArrayList<PlaceCard>(Arrays.asList(marais, abri, epave, source, artefact)), 2).getPlaceCards(), game.getReserve().getPlaceCards());
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);
List<PlaceCard> placeCards = new ArrayList<>(Arrays.asList(marais, abri, epave, source, artefact));
assertEquals(new Reserve(placeCards, 2), game.getReserve());
}
@Test
void testTraqueCanResist() throws TException {
void testTraqueCanResist() {
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();
Board board = game.getBoard();
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));
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);
assertTrue(game.traqueCanResist());
game.getGameRoundVariables().setTraqueCanResist(false);
assertFalse(game.traqueCanResist());
}
@Test
void testPlayerResist_false() 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();
Board board = game.getBoard();
assertEquals(new Score(7, 13), board.getScore());
when(room.askAction(any(Integer.class), any(TAskAction.class)))
.thenReturn(new ActionChoosePower(0));
Response response = new Response(false, "Number must be 1 or 2");
assertEquals(response, game.playerResist(2, 3));
}
@Test
void testPlayerResist_falsePhase2() throws TException {
void testTraqueCanPickSurvivalCards() {
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();
Board board = game.getBoard();
assertEquals(new Score(7, 13), 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);
assertTrue(game.playerHasFinished(1, 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);
assertTrue(game.playerPlaceJeton(1, Collections.singletonList(new PlacedJeton(JetonSymbol.CREATURE, Collections.singletonList(Place.PLACE_ONE)))).state);
Response response = new Response(false, "Resist is only possible in PHASE_1");
assertEquals(response, game.playerResist(2, 2));
}
@Test
void testPlayerResist_true() 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();
Board board = game.getBoard();
assertEquals(new Score(7, 13), 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);
assertTrue(game.playerHasFinished(1, Phase.PHASE_1).state);
assertTrue(game.playerPlayCard(2, Collections.singletonList(plage)).state);
Response response = new Response(true, "");
assertEquals(response, game.playerResist(2, 2));
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);
assertTrue(game.traqueCanPickSurvivalCards());
game.getGameRoundVariables().setTraqueCanPickSurvivalCards(false);
assertFalse(game.traqueCanPickSurvivalCards());
}
@Test
void testTraqueCanPickSurvivalCards() throws TException {
void testPlayTrackingCard_creatureCantPlayCards() {
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();
Board board = game.getBoard();
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));
assertTrue(game.traqueCanPickSurvivalCards());
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);
Response response = new Response(false, "Unable to play this card");
assertEquals(response, game.creaturePlayTrackingCard(game.getCreature(), acharnement));
}
@Test
void testCreaturePlayTrackingCard_sendErrorMessage() throws TException {
void testCanPlayTrackingCard_badPhase() {
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();
Board board = game.getBoard();
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));
/*test creaturePlayTrackingCard*/
Response response2 = new Response(false, "Unable to play this card");
assertEquals(response2, game.creaturePlayTrackingCard(game.getCreature(), acharnement));
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(acharnement);
assertFalse(game.creatureCanPlayThisTrackingCards(game.getCreature(), Collections.singletonList(acharnement)));
}
@Test