Esempio n. 1
0
        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");
        }
Esempio n. 2
0
        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");
        }
Esempio n. 3
0
        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");
        }
Esempio n. 4
0
        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");
        }
Esempio n. 5
0
        public void NotStartedStateIsInit()
        {
            //Arrange
            var nfo = new ModularGameMock().Empty();

            //Act

            //Assert
            Assert.AreEqual(GameStateEnum.Init, nfo.Game.State, "The game should not be started");
        }
Esempio n. 6
0
        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");
        }
Esempio n. 7
0
        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");
        }
Esempio n. 8
0
        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");
        }
Esempio n. 9
0
        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");
        }
Esempio n. 10
0
        public void AfterStartedStateIsWaitForPlayers()
        {
            //Arrange
            var nfo = new ModularGameMock().EmptyButStarted();

            //Act

            //Assert
            Assert.AreEqual(GameStateEnum.WaitForPlayers, nfo.Game.State, "The game should wait for players");
        }
Esempio n. 11
0
        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");
        }
Esempio n. 13
0
        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");
        }
Esempio n. 14
0
        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");
        }
Esempio n. 15
0
        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");
        }
Esempio n. 16
0
        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");
        }
Esempio n. 17
0
        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");
        }
Esempio n. 18
0
        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");
        }
Esempio n. 19
0
        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");
        }
Esempio n. 20
0
        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");
        }
Esempio n. 21
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");
        }
Esempio n. 22
0
        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");
        }
Esempio n. 23
0
        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");
        }
Esempio n. 24
0
        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");
        }
Esempio n. 25
0
        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");
        }
Esempio n. 26
0
        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");
        }
Esempio n. 27
0
        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");
        }
Esempio n. 28
0
        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");
        }
Esempio n. 29
0
        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");
        }
Esempio n. 30
0
        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");
        }