Ejemplo n.º 1
0
        public void Then_Is_Any_Above_Thirty_Is_True()
        {
            var points = new GamePoints {
                PlayerTwo = 3
            };

            Assert.IsTrue(points.IsAnyAboveThirty());
        }
Ejemplo n.º 2
0
        static string ScoreForPlayersEqual(GamePoints points)
        {
            string scoreOfPlayerOne = Game.ScoreForPoint(points.PlayerOne);

              return points.IsAnyAboveThirty()
            ? "Deuce"
            : scoreOfPlayerOne + " All";
        }
Ejemplo n.º 3
0
        static string ScoreForPlayersEqual(GamePoints points)
        {
            string scoreOfPlayerOne = Game.ScoreForPoint(points.PlayerOne);

            return(points.IsAnyAboveThirty()
        ? "Deuce"
        : scoreOfPlayerOne + " All");
        }
Ejemplo n.º 4
0
        static string ScoreForPlayerLeading(GamePoints points)
        {
            string scoreOfPlayerOne = Game.ScoreForPoint(points.PlayerOne);
              string scoreOfPlayerTwo = Game.ScoreForPoint(points.PlayerTwo);

              return points.IsAnyInAdvantage()
            ? ScoreForPlayerLeadingInAdvantage(points)
            : scoreOfPlayerOne + " " + scoreOfPlayerTwo;
        }
Ejemplo n.º 5
0
        static string ScoreForPlayerLeading(GamePoints points)
        {
            string scoreOfPlayerOne = Game.ScoreForPoint(points.PlayerOne);
            string scoreOfPlayerTwo = Game.ScoreForPoint(points.PlayerTwo);

            return(points.IsAnyInAdvantage()
        ? ScoreForPlayerLeadingInAdvantage(points)
        : scoreOfPlayerOne + " " + scoreOfPlayerTwo);
        }
Ejemplo n.º 6
0
        public static Game At(int pointsOfPlayerOne, int pointsOfPlayerTwo)
        {
            var points = new GamePoints { PlayerOne = pointsOfPlayerOne, PlayerTwo = pointsOfPlayerTwo };
              var score = Game.ScoreForPoints(points);

              return new Game {
            Points = points,
            Score = score
              };
        }
Ejemplo n.º 7
0
        public static Game At(int pointsOfPlayerOne, int pointsOfPlayerTwo)
        {
            var points = new GamePoints {
                PlayerOne = pointsOfPlayerOne, PlayerTwo = pointsOfPlayerTwo
            };
            var score = Game.ScoreForPoints(points);

            return(new Game {
                Points = points,
                Score = score
            });
        }
Ejemplo n.º 8
0
 static string ScoreForPoints(GamePoints points)
 {
     return points.AreEqual()
     ? ScoreForPlayersEqual(points)
     : ScoreForPlayerLeading(points);
 }
Ejemplo n.º 9
0
 static string ScoreForPlayerLeadingInAdvantage(GamePoints points)
 {
     return points.IsAnyLeadingBy(2)
     ? points.IsPlayerOneLeading() ? "Game Player One" : "Game Player Two"
     : points.IsPlayerOneLeading() ? "Advantage Player One" : "Advantage Player Two";
 }
Ejemplo n.º 10
0
 public void Then_Is_Any_Above_Thirty_Is_True()
 {
     var points = new GamePoints { PlayerTwo = 3 };
       Assert.IsTrue(points.IsAnyAboveThirty());
 }
Ejemplo n.º 11
0
 static string ScoreForPlayerLeadingInAdvantage(GamePoints points)
 {
     return(points.IsAnyLeadingBy(2)
 ? points.IsPlayerOneLeading() ? "Game Player One" : "Game Player Two"
 : points.IsPlayerOneLeading() ? "Advantage Player One" : "Advantage Player Two");
 }
Ejemplo n.º 12
0
 static string ScoreForPoints(GamePoints points)
 {
     return(points.AreEqual()
 ? ScoreForPlayersEqual(points)
 : ScoreForPlayerLeading(points));
 }