public void testTwoPlayersNormalCase(){
TableConfiguration configuration = new TableConfiguration();
table = new ServerTable(configuration);
PlayingTableState gameControl;
try {
kenzo = new MutableSeatedPlayer(factory.createNewPlayer("kenzo", 100), 100);
cedric = new MutableSeatedPlayer(factory.createNewPlayer("cedric", 100), 100);
table.addPlayer(kenzo);
table.addPlayer(cedric);
gameControl = new PlayingTableState(pokerTable, table, kenzo);
events.ignore(); //TODO
try {
gameControl.deal();
} catch (IllegalActionException e1) {
fail(e1.toString());
}
try {
gameControl.check(kenzo);
fail("Exception Expected.");
} catch (IllegalActionException e) {
}
try {
gameControl.call(kenzo);
gameControl.check(cedric);
} catch (IllegalActionException e) {
fail(e.getMessage());
}
assertEquals(FlopRound.class, gameControl.getRound().getClass());
try {
gameControl.check(cedric);
gameControl.check(kenzo);
} catch (IllegalActionException e) {
fail(e.getMessage());
}
assertEquals(TurnRound.class, gameControl.getRound().getClass());
try {
gameControl.check(cedric);
gameControl.check(kenzo);
} catch (IllegalActionException e) {
fail(e.getMessage());
}
assertEquals(FinalRound.class, gameControl.getRound().getClass());
try {
gameControl.check(cedric);
gameControl.check(kenzo);
} catch (IllegalActionException e) {
fail(e.getMessage());
}
assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
} catch (IllegalValueException e) {
fail(e.getMessage());
} catch (PlayerListFullException e) {
fail(e.getMessage());