public void AfterBothPlayerSeatedAntesStateIsWaitForBlinds() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Antes)).WithAllPlayersSeated(); //Act //Assert Assert.AreEqual(GameStateEnum.WaitForBlinds, nfo.Game.State, "The game should now wait for blinds"); }
public void AfterAntesRoundIsPreflop() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Antes)).BlindsPosted(); //Act //Assert Assert.AreEqual(1, nfo.Game.Table.BettingRoundId, "The game should now be in the preflop round"); }
public void AfterBothPlayerCallOnPreflopRoundNowFlop() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).AfterPreflop(); //Act //Assert Assert.AreEqual(2, nfo.Game.Table.BettingRoundId, "The game should now be in the flop round"); }
public void AfterBlindsGameStateIsPlaying() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted(); //Act //Assert Assert.AreEqual(GameStateEnum.Playing, nfo.Game.State, "The game should now be in the playing state"); }
public void NotStartedStateIsInit() { //Arrange var nfo = new ModularGameMock().Empty(); //Act //Assert Assert.AreEqual(GameStateEnum.Init, nfo.Game.State, "The game should not be started"); }
public void AfterSeatedInNoBlindsRoundIsPreflop() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.None)).WithAllPlayersSeated(); //Act //Assert Assert.AreEqual(1, nfo.Game.Table.BettingRoundId, "The game should now be in the preflop round"); }
public void AfterBothPlayerSeatedGameWithoutBlindsStateIsPlaying() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.None)).WithAllPlayersSeated(); //Act //Assert Assert.AreEqual(GameStateEnum.Playing, nfo.Game.State, "The game should now be in the playing state"); }
public void AfterTurnRoundIsRiver() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).AfterTurn(); //Act //Assert Assert.AreEqual(4, nfo.Game.Table.BettingRoundId, "The game should now be in the river round"); }
public void After1PlayerSeatedStateIsStillWaitForPlayers() { //Arrange var nfo = new ModularGameMock().WithP1Seated(); //Act //Assert Assert.AreEqual(GameStateEnum.WaitForPlayers, nfo.Game.State, "The game should still wait for players to sit in when only 1 is seated"); }
public void AfterStartedStateIsWaitForPlayers() { //Arrange var nfo = new ModularGameMock().EmptyButStarted(); //Act //Assert Assert.AreEqual(GameStateEnum.WaitForPlayers, nfo.Game.State, "The game should wait for players"); }
public void AfterPlayerFoldStateIsWaitForBlinds() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted(); //Act nfo.CurrentPlayerFolds(); //Assert Assert.AreEqual(GameStateEnum.WaitForBlinds, nfo.Game.State, "The game should be back waiting for blinds sincepot was won and it's starting over"); }
public void ObtainSeatWhenAlreadySeated() { //Arrange var nfo = new ModularGameMock().WithP1Seated(); //Act var res = nfo.Game.Table.SitIn(nfo.P1); //Assert Assert.AreEqual(null, res, "You should not be able to obtain a seat in twice"); }
public void Game3PNoBlindsUtgIsNextToDealerOnPreflop() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.None), new NbPlayersModule(3)).WithAllPlayersSeated(); //Act var res = nfo.PlayerNextTo(nfo.Dealer); //Assert Assert.AreEqual(nfo.CurrentPlayer, res, "Player next to dealer should be under the gun on preflop"); }
public void StartGameAndTryPutBlind() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).WithAllPlayersSeated(); //Act var res = nfo.Game.PlayMoney(nfo.P1, nfo.BlindNeeded(nfo.P1)); //Assert Assert.AreEqual(true, res, "The game should accept a perfect blind"); }
public void Game3PSmallIsNextToDealer() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds), new NbPlayersModule(3)).WithAllPlayersSeated(); //Act var res = nfo.PlayerNextTo(nfo.Dealer); //Assert Assert.AreEqual(nfo.CalculatedSmallBlind, res, "Player Next To SeatOfDealer should be the small blind"); }
public void AnteGame4PEverybodyIsBlind() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Antes), new NbPlayersModule(4)).WithAllPlayersSeated(); //Act var res = nfo.Players.Count(x => nfo.BlindNeeded(x) > 0); //Assert Assert.AreEqual(4, res, "SeatOfDealer should be the small blind"); }
public void AtStartOfBettingFirstPlayerChecks() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).AfterPreflop(); //Act var res = nfo.CurrentPlayerChecks(); //Assert Assert.AreEqual(true, res, "The first player should be allowed to call"); }
public void IfPlayingPlayerLeftStateIsWaitForPlayers() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted(); //Act nfo.Game.LeaveGame(nfo.CurrentPlayer); //Assert Assert.AreEqual(GameStateEnum.WaitForPlayers, nfo.Game.State, "The game should now be waiting for players: cp left (folded), other player wins the pot, and the game goes back to waiting for players"); }
public void IfOnelayerLeftDuringBlindsStateIsStillWaitForBlinds() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).WithAllPlayersSeated(); //Act nfo.Game.LeaveGame(nfo.P1); //Assert Assert.AreEqual(GameStateEnum.WaitForBlinds, nfo.Game.State, "The game should still be waiting for blinds waiting for P2 blind"); }
public void AfterPlayerLeftStateIsWaitForPlayers() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted(); //Act nfo.Game.LeaveGame(nfo.CurrentPlayer); //Assert Assert.AreEqual(GameStateEnum.WaitForPlayers, nfo.Game.State, "The game should be back waiting for players since only one player is left"); }
public void AfterFirstPlayerCallRoundStillPreflop() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted(); //Act nfo.CurrentPlayerCalls(); //Assert Assert.AreEqual(1, nfo.Game.Table.BettingRoundId, "The game should still be in the preflop round"); }
public void AfterFirstBlindStateIsStillWaitForBlinds() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).WithAllPlayersSeated(); //Act nfo.PutBlinds(nfo.P1); //Assert Assert.AreEqual(GameStateEnum.WaitForBlinds, nfo.Game.State, "The game should still wait for blinds, missing the one from p2"); }
public void AfterBlindsFirstPlayerCanCall() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted(); //Act var res = nfo.CurrentPlayerCalls(); //Assert Assert.AreEqual(true, res, "The first player should be allowed to call"); }
public void Game4PUtgIsNextToBigBlindOnPreflop() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds), new NbPlayersModule(4)).BlindsPosted(); //Act var res = nfo.PlayerNextTo(nfo.PlayerNextTo(nfo.PlayerNextTo(nfo.Dealer))); //Assert Assert.AreEqual(nfo.CurrentPlayer, res, "Player next to big blind should be under the gun on preflop"); }
public void AtStartOfBettingFirstPlayerBetsUnderMinimum() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).AfterPreflop(); //Act var res = nfo.CurrentPlayerPlays(nfo.Game.Table.MinRaiseAmountForPlayer(nfo.CurrentPlayer) - 1); //Assert Assert.AreEqual(false, res, "The player should not be able to raise under the minimum"); }
public void Game2PUtgIsDealerOnPreflop() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted(); //Act var res = nfo.Dealer; //Assert Assert.AreEqual(nfo.CurrentPlayer, res, "SeatOfDealer should be under the gun on preflop"); }
public void Game2PBigIsNextToDealer() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).WithAllPlayersSeated(); //Act var res = nfo.PlayerNextTo(nfo.Dealer); //Assert Assert.AreEqual(nfo.CalculatedBigBlind, res, "Player Next To SeatOfDealer should be the big blind"); }
public void Game2PAntesUtgIsNextToDealerOnFlop() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Antes)).AfterPreflop(); //Act var res = nfo.PlayerNextTo(nfo.Dealer); //Assert Assert.AreEqual(nfo.CurrentPlayer, res, "Player next to dealer should be under the gun on flop"); }
public void Game3PBigIsNextToSmall() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds), new NbPlayersModule(3)).WithAllPlayersSeated(); //Act var res = nfo.PlayerNextTo(nfo.CalculatedSmallBlind); //Assert Assert.AreEqual(nfo.CalculatedBigBlind, res, "Player Next To CalculatedSmallBlind should be the big blind"); }
public void StartGameAndTryPutBlindLessThanNeeded() { //Arrange var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).WithAllPlayersSeated(); //Act var res = nfo.Game.PlayMoney(nfo.P1, nfo.BlindNeeded(nfo.P1) - 1); //Assert Assert.AreEqual(false, res, "The game should not accept any blind that is under what is needed unless that is all the player got"); }