use of com.faforever.server.entity.Game in project faf-java-server by FAForever.
the class GameServiceTest method reportDesync.
@Test
public void reportDesync() throws Exception {
Game game = hostGame(player1);
assertThat(game.getDesyncCounter().intValue(), is(0));
instance.reportDesync(player1);
instance.reportDesync(player1);
instance.reportDesync(player1);
assertThat(game.getDesyncCounter().intValue(), is(3));
}
use of com.faforever.server.entity.Game in project faf-java-server by FAForever.
the class GameServiceTest method updateGameValidityPrebuiltEnabled.
@Test
public void updateGameValidityPrebuiltEnabled() throws Exception {
Game game = hostGame(player1);
game.getOptions().put(OPTION_PREBUILT_UNITS, "On");
launchGame(game);
instance.updateGameValidity(game);
assertThat(game.getValidity(), is(Validity.PREBUILT_ENABLED));
}
use of com.faforever.server.entity.Game in project faf-java-server by FAForever.
the class GameServiceTest method joinGame.
@Test
public void joinGame() throws Exception {
Game game = hostGame(player1);
instance.joinGame(game.getId(), game.getPassword(), player2);
verify(clientService).startGameProcess(game, player2);
assertThat(player2.getCurrentGame(), is(game));
assertThat(player2.getGameState(), is(PlayerGameState.INITIALIZING));
instance.updatePlayerGameState(PlayerGameState.LOBBY, player2);
assertThat(player2.getCurrentGame(), is(game));
}
use of com.faforever.server.entity.Game in project faf-java-server by FAForever.
the class GameServiceTest method updateGameValidityWrongVictoryConditionEradicationNotCoop.
@Test
public void updateGameValidityWrongVictoryConditionEradicationNotCoop() throws Exception {
Game game = hostGame(player1);
game.setVictoryCondition(VictoryCondition.ERADICATION);
when(modService.isCoop(any())).thenReturn(false);
launchGame(game);
instance.updateGameValidity(game);
assertThat(game.getValidity(), is(Validity.WRONG_VICTORY_CONDITION));
}
use of com.faforever.server.entity.Game in project faf-java-server by FAForever.
the class GameServiceTest method mutualDrawRequestedByPlayer.
@Test
public void mutualDrawRequestedByPlayer() throws Exception {
Game game = hostGame(player1);
instance.updatePlayerOption(player1, player1.getId(), OPTION_TEAM, GameService.NO_TEAM_ID);
launchGame(game);
instance.mutuallyAgreeDraw(player1);
assertThat(game.isMutuallyAgreedDraw(), is(true));
}
Aggregations