コード例 #1
0
ファイル: BlindsTests.cs プロジェクト: VirtualTaluva/Server
        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");
        }
コード例 #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");
        }
コード例 #3
0
ファイル: BlindsTests.cs プロジェクト: VirtualTaluva/Server
        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");
        }
コード例 #4
0
ファイル: BlindsTests.cs プロジェクト: VirtualTaluva/Server
        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");
        }
コード例 #5
0
ファイル: BlindsTests.cs プロジェクト: VirtualTaluva/Server
        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");
        }
コード例 #6
0
ファイル: BlindsTests.cs プロジェクト: VirtualTaluva/Server
        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)");
        }
コード例 #7
0
ファイル: BlindsTests.cs プロジェクト: VirtualTaluva/Server
        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");
        }