예제 #1
0
 public static void PlayerTwoScore(this TennisGame tennisGame, int points)
 {
     for (int i = 0; i < points; i++)
     {
         tennisGame.PlayerTwoScore();
     }
 }
예제 #2
0
        public void PlayerTwoScoreOnePointLove30()
        {
            var tennisGame = new TennisGame();

            tennisGame.PlayerTwoScore(2);

            Assert.Equal("love 30", tennisGame.GetScore());
        }
예제 #3
0
        public void DeuceThreePoints()
        {
            var tennisGame = new TennisGame();

            tennisGame.PlayerOneScore(3);
            tennisGame.PlayerTwoScore(3);

            Assert.Equal("deuce", tennisGame.GetScore());
        }
예제 #4
0
        public void BothScoreTwice()
        {
            var tennisGame = new TennisGame();

            tennisGame.PlayerOneScore(2);
            tennisGame.PlayerTwoScore(2);

            Assert.Equal("30 all", tennisGame.GetScore());
        }
예제 #5
0
        public void WinnerPlayerTwo()
        {
            var tennisGame = new TennisGame();

            tennisGame.PlayerOneScore(2);
            tennisGame.PlayerTwoScore(4);

            Assert.Equal("winner player2", tennisGame.GetScore());
        }
예제 #6
0
        public void AdvantagePlayerTwo()
        {
            var tennisGame = new TennisGame();

            tennisGame.PlayerOneScore(4);
            tennisGame.PlayerTwoScore(5);

            Assert.Equal("advantage player2", tennisGame.GetScore());
        }
예제 #7
0
 public void PlayerTwoWinFirstBall()
 {
     _game.PlayerTwoScore();
     Assert.AreEqual("love-fifteen", _game.GetScore());
 }