示例#1
0
 public static void PlayerOneScore(this TennisGame tennisGame, int points)
 {
     for (int i = 0; i < points; i++)
     {
         tennisGame.PlayerOneScore();
     }
 }
示例#2
0
        public void PlayerOneScoreThreePoints40Love()
        {
            var tennisGame = new TennisGame();

            tennisGame.PlayerOneScore(3);

            Assert.Equal("40 love", tennisGame.GetScore());
        }
示例#3
0
        public void PlayerOneScoreTwoPoints30Love()
        {
            var tennisGame = new TennisGame();

            tennisGame.PlayerOneScore(2);

            Assert.Equal("30 love", tennisGame.GetScore());
        }
示例#4
0
        public void PlayerOneScorePoint15Love()
        {
            var tennisGame = new TennisGame();

            tennisGame.PlayerOneScore(1);

            Assert.Equal("15 love", tennisGame.GetScore());
        }
示例#5
0
        public void DeuceThreePoints()
        {
            var tennisGame = new TennisGame();

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

            Assert.Equal("deuce", tennisGame.GetScore());
        }
示例#6
0
        public void BothScoreTwice()
        {
            var tennisGame = new TennisGame();

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

            Assert.Equal("30 all", tennisGame.GetScore());
        }
示例#7
0
        public void WinnerPlayerTwo()
        {
            var tennisGame = new TennisGame();

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

            Assert.Equal("winner player2", tennisGame.GetScore());
        }
示例#8
0
        public void AdvantagePlayerTwo()
        {
            var tennisGame = new TennisGame();

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

            Assert.Equal("advantage player2", tennisGame.GetScore());
        }
 public void PlayerOneWinFirstBall()
 {
     _game.PlayerOneScore();
     Assert.AreEqual("fifteen-love", _game.GetScore());
 }