}
}
public void testCase1() {
PlayingTableState gameControl = new PlayingTableState(pokerTable, table, kenzo);
Game game = gameControl.getGame();
events.ignore(); //TODO
try {
gameControl.deal();
} catch (IllegalActionException e1) {
fail(e1.toString());
}
// Pre-flop Round
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
assertTrue(game.getCurrentPlayer().equals(kenzo));
try {
gameControl.call(game.getCurrentPlayer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
gameControl.call(game.getCurrentPlayer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
// Big Blind Checks.
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// Flop Round
assertEquals(FlopRound.class, gameControl.getRound().getClass());
try {
gameControl.check(game.getCurrentPlayer());
assertEquals(FlopRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
assertEquals(FlopRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// Turn Round
assertEquals(TurnRound.class, gameControl.getRound().getClass());
try {
gameControl.check(game.getCurrentPlayer());
assertEquals(TurnRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
assertEquals(TurnRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// Final Round
assertEquals(FinalRound.class, gameControl.getRound().getClass());
try {
gameControl.check(game.getCurrentPlayer());
assertEquals(FinalRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
assertEquals(FinalRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// New Deal
assertEquals(cedric, game.getDealer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
try {
gameControl.call(game.getCurrentPlayer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
gameControl.call(game.getCurrentPlayer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// Flop Round
assertEquals(FlopRound.class, gameControl.getRound().getClass());
try {
gameControl.check(game.getCurrentPlayer());
assertEquals(FlopRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
assertEquals(FlopRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// Turn Round
assertEquals(TurnRound.class, gameControl.getRound().getClass());
try {
gameControl.check(game.getCurrentPlayer());
assertEquals(TurnRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
assertEquals(TurnRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// Final Round
assertEquals(FinalRound.class, gameControl.getRound().getClass());
try {
gameControl.check(game.getCurrentPlayer());
assertEquals(FinalRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
assertEquals(FinalRound.class, gameControl.getRound().getClass());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// New Deal
assertEquals(guy, game.getDealer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
}