public void Then_Is_Any_Above_Thirty_Is_True() { var points = new GamePoints { PlayerTwo = 3 }; Assert.IsTrue(points.IsAnyAboveThirty()); }
static string ScoreForPlayersEqual(GamePoints points) { string scoreOfPlayerOne = Game.ScoreForPoint(points.PlayerOne); return points.IsAnyAboveThirty() ? "Deuce" : scoreOfPlayerOne + " All"; }
static string ScoreForPlayersEqual(GamePoints points) { string scoreOfPlayerOne = Game.ScoreForPoint(points.PlayerOne); return(points.IsAnyAboveThirty() ? "Deuce" : scoreOfPlayerOne + " All"); }
static string ScoreForPlayerLeading(GamePoints points) { string scoreOfPlayerOne = Game.ScoreForPoint(points.PlayerOne); string scoreOfPlayerTwo = Game.ScoreForPoint(points.PlayerTwo); return points.IsAnyInAdvantage() ? ScoreForPlayerLeadingInAdvantage(points) : scoreOfPlayerOne + " " + scoreOfPlayerTwo; }
static string ScoreForPlayerLeading(GamePoints points) { string scoreOfPlayerOne = Game.ScoreForPoint(points.PlayerOne); string scoreOfPlayerTwo = Game.ScoreForPoint(points.PlayerTwo); return(points.IsAnyInAdvantage() ? ScoreForPlayerLeadingInAdvantage(points) : scoreOfPlayerOne + " " + scoreOfPlayerTwo); }
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 }; }
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 }); }
static string ScoreForPoints(GamePoints points) { return points.AreEqual() ? ScoreForPlayersEqual(points) : ScoreForPlayerLeading(points); }
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"; }
public void Then_Is_Any_Above_Thirty_Is_True() { var points = new GamePoints { PlayerTwo = 3 }; Assert.IsTrue(points.IsAnyAboveThirty()); }
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"); }
static string ScoreForPoints(GamePoints points) { return(points.AreEqual() ? ScoreForPlayersEqual(points) : ScoreForPlayerLeading(points)); }