public void Serving_player_makes_a_point() { // Arrange var servingPlayer = new Player("servingPlayer"); var receivingPlayer = new Player("receivingPlayer"); var game = new TennisGame(servingPlayer, receivingPlayer); // Act game.Serve().Miss(); // Assert Assert.Equal("Fifteen - Love", game.Score); }
public void No_one_makes_a_point() { // Arrange var servingPlayer = new Player("servingPlayer"); var receivingPlayer = new Player("receivingPlayer"); var game = new TennisGame(servingPlayer, receivingPlayer); // Act game.Serve().Return(); // Assert Assert.Equal("Love all", game.Score); }
public void Scoring_happens_on_faulty_returns_or_double_servefaults() { // Arrange var servingPlayer = new Player("servingPlayer"); var receivingPlayer = new Player("receivingPlayer"); var game = new TennisGame(servingPlayer, receivingPlayer); // Act & assert 1st rally game.Serve().Return().Miss(); Assert.Equal("Love - Fifteen", game.Score); // Act & assert 2nd rally game.Serve().Miss(); Assert.Equal("Fifteen all", game.Score); // Act & assert 3rd rally game.ServeFaulty().ServeFaulty(); Assert.Equal("Fifteen - Thirty", game.Score); // Act & assert fourth rally game.Serve().Return().Return().Miss(); Assert.Equal("Thirty all", game.Score); }
private static void PlayerOneScores(TennisGame game) { game.Serve().Miss(); }
private static void PlayerOneWinsRally(TennisGame game) { game.Serve().Miss(); }
private static I_am_serving PlayerTwoWinsRally(TennisGame game) { return(game.Serve().Return().Miss()); }