Example #1
0
        public void AfterFirstPlayerCallSecondPlayerCanCall()
        {
            //Arrange
            var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted();

            nfo.CurrentPlayerCalls();

            //Act
            var res = nfo.CurrentPlayerCalls();

            //Assert
            Assert.AreEqual(true, res, "The second player should be allowed to call");
        }
Example #2
0
        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");
        }
Example #3
0
        public void AfterSecondPlayerCallsNowTurn()
        {
            //Arrange
            var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).AfterPreflop();

            //Act
            nfo.CurrentPlayerRaisesMinimum();
            nfo.CurrentPlayerCalls();

            //Assert
            Assert.AreEqual(3, nfo.Game.Table.BettingRoundId, "The game should now be in the Turn round");
        }
Example #4
0
        public void IfOtherLeftThenCurrentPlaysStateIsNowWaitingForPlayers()
        {
            //Arrange
            var nfo         = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted();
            var otherPlayer = nfo.Game.Table.Seats.SeatOfPlayingPlayerNextTo(nfo.Game.Table.Seats[nfo.CurrentPlayer.NoSeat]).Player;

            nfo.Game.LeaveGame(otherPlayer);

            //Act
            nfo.CurrentPlayerCalls();

            //Assert
            Assert.AreEqual(GameStateEnum.WaitForPlayers, nfo.Game.State, "The game should be back waiting for players: cp plays, np folds since he left, player wins the pot, and the game goes back to waiting for players");
        }
Example #5
0
        public void AllIn()
        {
            //Arrange
            var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).AfterPreflop();

            if (nfo.CurrentPlayer == nfo.PoorestPlayer)
            {
                nfo.CurrentPlayerChecks();
            }
            nfo.CurrentPlayerPlays(nfo.PoorestPlayer.MoneySafeAmnt + 10);

            //Act
            var res = nfo.CurrentPlayerCalls();

            //Assert
            Assert.AreEqual(true, res, "The first player should be allowed to go all-in");
        }