Exemplo n.º 1
0
        public void StartSecondGameAndCheckNeededBlindOfBothPlayers()
        {
            //Arrange
            var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).BlindsPosted();

            //Act
            nfo.CurrentPlayerFolds(); // This will start a new game !
            var res = nfo.BlindNeeded(nfo.P1) != nfo.BlindNeeded(nfo.P2);

            //Assert
            Assert.AreEqual(true, res, "The second game should need a big blind and a small blind, not two big blinds");
        }
Exemplo n.º 2
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");
        }
Exemplo n.º 3
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");
        }
Exemplo n.º 4
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");
        }
Exemplo n.º 5
0
        public void StartGameAndCheckNeededBlindP2()
        {
            //Arrange
            var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).WithAllPlayersSeated();

            //Act
            var res = nfo.BlindNeeded(nfo.P2);

            //Assert
            Assert.AreNotEqual(0, res, "The game should need a blind from p2");
        }
Exemplo n.º 6
0
        public void AntesGameAllPlayerNeedsToPutTheSameBlind()
        {
            //Arrange
            var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Antes), new NbPlayersModule(4)).WithAllPlayersSeated();

            //Act
            var res = nfo.Players.All(x => nfo.BlindNeeded(x) == nfo.Game.Table.Params.AnteAmount());

            //Assert
            Assert.AreEqual(true, res, "The game should need the same blind for everybody (Antes)");
        }
Exemplo n.º 7
0
        public void StartGameAndCheckNeededBlindP1AfterP1PutHis()
        {
            //Arrange
            var nfo = new ModularGameMock(new BlindModule(BlindTypeEnum.Blinds)).WithAllPlayersSeated();

            nfo.PutBlinds(nfo.P1);

            //Act
            var res = nfo.BlindNeeded(nfo.P1);

            //Assert
            Assert.AreEqual(0, res, "The game should not need a blind from p1 anymore");
        }