GetScore() public method

public GetScore ( ) : string
return string
コード例 #1
0
 public void CheckAllScores()
 {
     var game = new TennisGame("player1", "player2");
     for (int i = 0; i < this.player1Score; i++)
         game.WonPoint("player1");
     for (int i = 0; i < this.player2Score; i++)
         game.WonPoint("player2");
     Assert.AreEqual(this.expectedScore, game.GetScore());
 }
コード例 #2
0
 public void RealisticGame()
 {
     var game = new TennisGame("player1", "player2");
     string[] points = {"player1", "player1", "player2", "player2", "player1", "player1"};
     string[] expected_scores = { "Fifteen-Love", "Thirty-Love", "Thirty-Fifteen", "Thirty-All", "Forty-Thirty", "Win for player1" };
     for (int i = 0; i < 6; i++)
     {
         game.WonPoint(points[i]);
         Assert.AreEqual(expected_scores[i], game.GetScore());
     }
 }