Пример #1
0
        public void Test_StartGame_BoardStateIsPreFlop_IsTrue()
        {
            Table table = new Table(4, 0);

            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));

            table.StartGame();

            Assert.AreEqual(table.Board.BoardState, BoardStateType.Preflop);
        }
Пример #2
0
        public void Test_Turn_AfterStartGame_ThrowsException()
        {
            Table table = new Table(4, 0);

            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));

            table.StartGame();

            Exception exception = Assert.Throws <Exception>(() => table.Turn());

            Assert.AreEqual(exception.Message, "The board has to go through Flop first!");
        }
Пример #3
0
        public void Test_Turn_BoardStateIsTurn_IsTrue()
        {
            Table table = new Table(4, 0);

            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));

            table.StartGame();
            table.Flop();
            table.Turn();

            Assert.AreEqual(table.Board.BoardState, BoardStateType.Turn);
        }
Пример #4
0
        public void Test_StartGame_WithPlayers_HaveCards(int seatNumber)
        {
            Table table = new Table(4, 0);

            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));

            table.StartGame();

            bool expected = table.Players.ToList()[seatNumber].HasCards();

            Assert.AreEqual(expected, true);
        }
Пример #5
0
        public void Test_River_WhenInFlop_ThrowsException()
        {
            Table table = new Table(4, 0);

            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));
            table.AddPlayer(new Player(500, 0));

            table.StartGame();
            table.Flop();

            Exception exception = Assert.Throws <Exception>(() => table.River());

            Assert.AreEqual(exception.Message, "The board has to go through Turn first!");
        }