Ejemplo n.º 1
0
        public void AddPlayerPoint()
        {
            Player firstPlayer  = new Player("Player1");
            Player secondPlayer = new Player("Player2");

            Tennis tennis = new Tennis(firstPlayer, secondPlayer);

            for (uint point = 1; point <= 10; point++)
            {
                tennis.SetPoints(firstPlayer);
                Assert.AreEqual(point, firstPlayer.Points);

                tennis.SetPoints(secondPlayer);
                Assert.AreEqual(point, secondPlayer.Points);
            }
        }
Ejemplo n.º 2
0
        public void StopSetPoints()
        {
            Player firstPlayer  = new Player("Player1");
            Player secondPlayer = new Player("Player2");

            Tennis tennis = new Tennis(firstPlayer, secondPlayer);

            Assert.AreEqual(null, tennis.HaveWinner());

            for (ushort point = 1; point < 6; point++)
            {
                tennis.SetPoints(firstPlayer);
                Assert.AreEqual(point < 4 ? point : 4, firstPlayer.Points);
            }
        }