Ejemplo n.º 1
0
        public void Test_RemovePlayer_ByExistingPlayer_IsOk()
        {
            Table  table  = new Table(4);
            Player player = new Player(500, 0);

            table.AddPlayer(player);

            Assert.DoesNotThrow(() => table.RemovePlayer(player));
        }
Ejemplo n.º 2
0
        public void Test_RemovePlayer_EmptyTable_ThrowsException()
        {
            Table table  = new Table(4);
            var   player = new Player(500, 0);

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

            Assert.AreEqual(exception.Message, "This player is not sitting in the table");
        }
Ejemplo n.º 3
0
        public void Test_RemovePlayer_FromSeatNumber_IsOk(int seatNumber)
        {
            Table table = new Table(4);

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

            Assert.DoesNotThrow(() => table.RemovePlayer(seatNumber));
        }
Ejemplo n.º 4
0
        public void Test_RemovePlayer_FromNonExistingSeat_ThrowsException()
        {
            Table table = new Table(4);

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

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

            Assert.AreEqual(exception.Message, "Sorry, seat not found");
        }
Ejemplo n.º 5
0
        public void Test_RemovePlayer_FromEmptySeat_ThrowsException()
        {
            Table table = new Table(4);

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

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

            Assert.AreEqual(exception.Message, "This seat is empty");
        }
Ejemplo n.º 6
0
        public void Test_RemovePlayer_DoesNotExist_ThrowsException()
        {
            Table table = new Table(4);

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

            Exception exception = Assert.Throws <Exception>(() => table.RemovePlayer(new Player(500, 0)));

            Assert.AreEqual(exception.Message, "This player is not sitting in the table");
        }