コード例 #1
0
  public void testThatItTakesFiveForTheHumanPlayerToWin() {
    fakeStrategy.playerSeriesSizes.put(Board.HUMAN_PLAYER_MARK, SERIES_SIZE_OF_FIVE);
    game.updateGameState();

    assertFalse(game.noWinnerYet());
    assertTrue(game.humanPlayerWon());
  }
コード例 #2
0
  // TODO: Declan 17-May-2009 - Updated to test for 6 row in a row rather than 5
  public void testThatItTakesSixForTheComputerToWin() {
    fakeStrategy.playerSeriesSizes.put(Board.COMPUTER_PLAYER_MARK, SERIES_SIZE_OF_SIX);
    game.updateGameState();

    assertFalse(game.noWinnerYet());
    assertTrue(game.computerWon());
  }
コード例 #3
0
  public void testThatHumanDoesNotWinWithFourInARow() {
    fakeStrategy.playerSeriesSizes.put(Board.HUMAN_PLAYER_MARK, SERIES_SIZE_OF_FOUR);

    assertTrue("there was a winner when there shouldn't be", game.noWinnerYet());
  }
コード例 #4
0
  // TODO: Declan 17-May-2009 - Updated to test for 5 row in a row rather than 4
  public void testThatComputerDoesNotWinWithFiveInARow() throws Exception {
    fakeStrategy.playerSeriesSizes.put(Board.COMPUTER_PLAYER_MARK, SERIES_SIZE_OF_FIVE);

    assertTrue("there was a winner when there shouldn't be", game.noWinnerYet());
  }