@Test//TODO add description here
public final void testMethods() throws GameException {
boardMap = BoardMapImpl.getNewInstance(MAPNAME);
game = GameImpl.getNewInstance("2", creator, boardMap);
final Game game2 = GameImpl.getNewInstance("3", creator, boardMap);
final Coordinate coor = new CoordinateImpl(boardMap, 1.1, 2.2);
final Coordinate coor1 = new CoordinateImpl(boardMap, 1.6, 2.6);
//Token token = new TokenImpl(detective, TransportationMethod.BUS);
final Link route = new LinkImpl(boardMap, TransportationMethod.BUS, coor, coor1);
//token.setNumberOfTickets(10);
detective.setTokens(game, TransportationMethod.BUS, 10);
final Token token = detective.getTokens(game).get(TransportationMethod.BUS);
Assert.assertEquals(detective.getNumberOfTickets(game, TransportationMethod.BUS),10);
detective.setPosition(game, coor);
detective.useTokenToMove(game, token, route);
Assert.assertEquals(detective.getNumberOfTickets(game, TransportationMethod.BUS),9);
Assert.assertEquals(token.getNumberOfTokens(),9);
detective.useTokenToMove(game, token, route);
// aren't these conflicting?
// 2Token token = new TokenImpl(detective, TransportationMethod.BUS);
// token.setNumberOfTickets(10);
// detective.setTokens(game, TransportationMethod.BUS, 10);
Assert.assertEquals(detective.toString(),"player1");
Assert.assertEquals(detective.getNumberOfTickets(game, TransportationMethod.BUS),8);
Assert.assertEquals(token.getNumberOfTokens(),8);
Assert.assertTrue(detective.toString().equals("player1"));
for(int x=8;x>0;x--){
detective.useTokenToMove(game, token, route);
}
try{
detective.useTokenToMove(game, token, route);
Assert.assertTrue(false);
}catch(GameException ex){
Assert.assertTrue(true);
}
Assert.assertEquals(detective.compareTo(detective),0);
game.addDetective((Detective) detective);
game2.addDetective((Detective) detective);
final Set<Game> currentgameslist = new HashSet<Game>();
currentgameslist.add(game);
currentgameslist.add(game2);