for(int i=0;i<objects.length;i++){
try{
final Player player = (Player) objects[i][0];
final Coordinate coor = (Coordinate) objects[i][1];
game.setPlayerPosition(new PlayerPositionImpl(game, player, coor)); // this must throw an exception
counter--;// should not reach here
}catch(GameException ex){
counter++;
}
}
Assert.assertEquals(counter, 3);
game.setGameStatus(GameStatus.JUST_CREATED);
final PlayerPosition playerPosition1 = new PlayerPositionImpl(game, detective, position1);
game.setPlayerPosition( playerPosition1 );
try{
//this should throw an exception since it places a player
//at the same position as another one is already there
game.setPlayerPosition( new PlayerPositionImpl(game, mrx, position1));
counter--;
}catch(GameException ex){
counter++;
}