Exemplo n.º 1
0
        public void RemovingPlayerNoPlayersDoesNotThrow()
        {
            var table  = new GameLogic.Table(6, new GameLogic.StakeInfo(1, 2));
            var player = new Models.Player("name", "key", 1000);

            table.RemovePlayer(player);
        }
Exemplo n.º 2
0
        public void RemovingPlayerReturnsMoney()
        {
            var table        = new GameLogic.Table(6, new GameLogic.StakeInfo(1, 2));
            var seatedPlayer = new Models.Player("seated", "key", 1000);

            table.AddPlayer(seatedPlayer);
            Assert.AreEqual(800, seatedPlayer.Cash, "Unexpected cash value on player after seating.");

            table.RemovePlayer(seatedPlayer);
            Assert.AreEqual(1000, seatedPlayer.Cash, "Upon leaving the table, the players cash value is incorrect.");
        }
Exemplo n.º 3
0
        public void RemovingNonSeatedPlayerDoesNotThrow()
        {
            var table        = new GameLogic.Table(6, new GameLogic.StakeInfo(1, 2));
            var seatedPlayer = new Models.Player("seated", "key", 1000);

            table.AddPlayer(seatedPlayer);

            var player = new Models.Player("name", "key", 1000);

            table.RemovePlayer(player);
        }
Exemplo n.º 4
0
        public void CanRemovePlayerAtCapacity()
        {
            var table        = new GameLogic.Table(6, new GameLogic.StakeInfo(1, 2));
            var seatedPlayer = new Models.Player("seated", "key", 1000);

            for (int i = 0; i < 5; i++)
            {
                table.AddPlayer(new Models.Player(i.ToString(), "key", 1000));
            }

            table.RemovePlayer(seatedPlayer);
        }
Exemplo n.º 5
0
        public void RemovingNonSeatedPlayerDoesntReturnMoney()
        {
            var table        = new GameLogic.Table(6, new GameLogic.StakeInfo(1, 2));
            var seatedPlayer = new Models.Player("seated", "key", 1000);

            table.AddPlayer(seatedPlayer);

            var player = new Models.Player("name", "key", 1000);

            table.RemovePlayer(player);

            Assert.AreEqual(1000, player.Cash, "The un-seated players cash value changed.");
        }