assertEquals(guy, game.getDealer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
}
public void testCase2() {
PlayingTableState gameControl = new PlayingTableState(pokerTable, table, guy);
events.ignore(); //TODO
try {
gameControl.deal();
} catch (IllegalActionException e1) {
fail(e1.toString());
}
Game game = gameControl.getGame();
// New Deal
assertEquals(guy, game.getDealer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
try {
System.out.println(game.getCurrentPlayer());
gameControl.call(game.getCurrentPlayer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
gameControl.raise(game.getCurrentPlayer(), 10);
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
gameControl.call(game.getCurrentPlayer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
gameControl.raise(game.getCurrentPlayer(), 20);
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
gameControl.call(game.getCurrentPlayer());
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
gameControl.call(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// Flop Round
assertEquals(FlopRound.class, gameControl.getRound().getClass());
try {
gameControl.check(game.getCurrentPlayer());
gameControl.check(game.getCurrentPlayer());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// Turn Round
assertEquals(TurnRound.class, gameControl.getRound().getClass());
try {
gameControl.check(game.getCurrentPlayer());
gameControl.check(game.getCurrentPlayer());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// Final Round
assertEquals(FinalRound.class, gameControl.getRound().getClass());
try {
gameControl.check(game.getCurrentPlayer());
gameControl.check(game.getCurrentPlayer());
gameControl.check(game.getCurrentPlayer());
} catch (IllegalActionException e) {
fail(e.getMessage());
}
// New Deal
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
}