示例#1
0
        private string GetLessThan4ScoreDescription()
        {
            var player1ScoreDescription = ScoreHelper.ScoreDescription(_player1Score);
            var player2ScoreDescription = ScoreHelper.ScoreDescription(_player2Score);

            return($"{player1ScoreDescription}-{player2ScoreDescription}");
        }
示例#2
0
        private string GetTieScoreDescription()
        {
            if (_player1Point > 2)
            {
                return("Deuce");
            }

            var scoreDescription = ScoreHelper.ScoreDescription(_player1Point);

            return($"{scoreDescription}-All");
        }
示例#3
0
 private string GetTieScoreDescription()
 {
     if (_player1Score < 3)
     {
         var scoreDescription = ScoreHelper.ScoreDescription(_player1Score);
         return($"{scoreDescription}-All");
     }
     else
     {
         return("Deuce");
     }
 }
示例#4
0
        public string GetScore()
        {
            if (ScoreIsTied())
            {
                return(GetTieScoreDescription());
            }

            if (BothPlayersHaveLessThan4Points())
            {
                var player1ScoreDescription = ScoreHelper.ScoreDescription(_player1Point);
                var player2ScoreDescription = ScoreHelper.ScoreDescription(_player2Point);

                return($"{player1ScoreDescription}-{player2ScoreDescription}");
            }

            if (Player1Leads())
            {
                return(GetPlayer1LeadingScore());
            }
            else
            {
                return(GetPlayer2LeadingScore());
            }
        }