public void NonExistingNameWonPoint() { var game = new TennisGame1("player1", "player2"); game.WonPoint("player3"); Assert.AreEqual(game.GetScore(), "Love-All"); }
public void PlayerOneWinsTwoGamesWithSecondGameGoingToAdvantage() { var game = new TennisGame1(new GameScore(player1Name, player2Name)); var pointsWon = new List <Point> { new Point(player1Name, "Fifteen-Love"), new Point(player1Name, "Thirty-Love"), new Point(player2Name, "Thirty-Fifteen"), new Point(player2Name, "Thirty-All"), new Point(player1Name, "Forty-Thirty"), new Point(player1Name, "Love-All"), new Point(player1Name, "Fifteen-Love"), new Point(player2Name, "Fifteen-All"), new Point(player1Name, "Thirty-Fifteen"), new Point(player2Name, "Thirty-All"), new Point(player2Name, "Thirty-Forty"), new Point(player1Name, "Deuce"), new Point(player1Name, "Advantage player1"), new Point(player2Name, "Deuce"), new Point(player1Name, "Advantage player1"), new Point(player1Name, "Love-All"), }; foreach (var pointWon in pointsWon) { game.WonPoint(pointWon.playerName); Assert.AreEqual(pointWon.score, game.GetScore()); } Assert.AreEqual(2, game.GetGamesWon(player1Name)); Assert.AreEqual(0, game.GetGamesWon(player2Name)); }
public void OnlyAllowTwoPlayers() { var game = new TennisGame1(new GameScore(player1Name, player2Name)); var exception = Assert.Throws <PlayerNotFoundException>(() => game.WonPoint("player3")); Assert.AreEqual("player3 not found.", exception.Message); }
public void ScoresAreAddedToCorrectPlayer() { TennisGame1 game = new TennisGame1("Gino", "Simon", ScoreType.WithAd); game.WonPoint("Gino"); game.WonPoint("Simon"); Assert.AreEqual("Fifteen-All", game.GetScore()); }
public void ActualPlayerHasWon() { var game = new TennisGame1("Vojta", "Jakub"); for (int i = 0; i < 6; ++i) { game.WonPoint("Vojta"); } Assert.AreEqual(game.GetScore(), "Win for Vojta"); }
public void CheckGame1() { player1 = new Player() { Name = "player1" }; player2 = new Player() { Name = "player2" }; var game = new TennisGame1(player1, player2); RealisticTennisGame(game); }
public void CheckGame1() { TennisGame1 game = new TennisGame1("player1", "player2"); RealisticTennisGame(game); }
public void checkTennisGame1() { TennisGame1 game = new TennisGame1("player1", "player2"); checkAllScores(game); }
public void CheckTennisGame1() { var game = new TennisGame1(this.Player1, this.Player2); CheckAllScores(game); }
public void checkTennisGame1() { TennisGame1 game = new TennisGame1("player1", "player2", ScoreType.WithAd); checkAllScores(game); }
public void CheckTennisGame1() { var game = new TennisGame1("player1", "player2"); CheckAllScores(game); }
public void CheckGame1() { var game = new TennisGame1(new GameScore(player1Name, player2Name)); RealisticTennisGame(game); }
public void CheckTennisGame1() { var game = new TennisGame1(); CheckAllScores(game); }
public void CheckGame1() { var game = new TennisGame1(); RealisticTennisGame(game); }
public void Tennis1Test(int p1, int p2, string expected) { var game = new TennisGame1("player1", "player2"); CheckAllScores(game, p1, p2, expected); }