Example #1
0
        public void Return_6_7_when_ItsTiebreack()
        {
            tennis = new TennisGame();

            Player1WinsAGame(); //1-0

            Player1WinsAGame(); //2-0

            Player1WinsAGame(); //3-0

            Player1WinsAGame(); //4-0

            Player1WinsAGame(); //5-0


            Player2WinsAGame(); //5-1

            Player2WinsAGame(); //5-2

            Player2WinsAGame(); //5-3

            Player2WinsAGame(); //5-4

            Player2WinsAGame(); //5-5

            Player1WinsAGame(); //6-5

            Player2WinsAGame(); //6-6

            //TIEBreack
            tennis.Player1WinsTheBall(); //1-0
            tennis.Player1WinsTheBall(); //2-0
            tennis.Player1WinsTheBall(); //3-0
            tennis.Player1WinsTheBall(); //4-0
            tennis.Player1WinsTheBall(); //5-0
            tennis.Player2WinsTheBall(); //5-1
            tennis.Player2WinsTheBall(); //5-2
            tennis.Player2WinsTheBall(); //5-3
            tennis.Player2WinsTheBall(); //5-4
            tennis.Player2WinsTheBall(); //5-5
            tennis.Player2WinsTheBall(); //5-6
            tennis.Player1WinsTheBall(); //6-6
            tennis.Player2WinsTheBall(); //6-7


            Assert.AreEqual(tennis.DisplayScore(), "6 - 7");
        }
Example #2
0
 public void Return_Deuce_If_ThreeBallForEach()
 {
     tennis.Player1WinsTheBall();
     tennis.Player2WinsTheBall();
     tennis.Player1WinsTheBall();
     tennis.Player2WinsTheBall();
     tennis.Player1WinsTheBall();
     tennis.Player2WinsTheBall();
     Assert.AreEqual(tennis.DisplayScore(), "deuce");
 }