コード例 #1
0
        public void ShouldReportScoreAsLoveAllWhenNeitherPlayersHaveAnyPoints()
        {
            //assert
            var score = tennisGame.GetScore();

            Assert.Equal("love - all", score);
        }
コード例 #2
0
ファイル: TennisGameTests.cs プロジェクト: HoschiS/Katas
 public void Test_FourScoresPlayerOneAndThreeScoresPlayerTwo_ScoreIsAdvantagePlayerOne()
 {
     var game = new TennisGame();
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_B);
     game.ScorePoint(TennisGame.PLAYER_B);
     game.ScorePoint(TennisGame.PLAYER_B);
     game.ScorePoint(TennisGame.PLAYER_A);
     Ashure.That(game.GetScore().Equals(TennisGame.ADVANTAGE_PLAYER_A));
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: lintingwei/Kata
        static void Main(string[] args)
        {
            TennisGame tennisGame = new TennisGame()
            {
                PlayerAScore = 5,
                PlayerBScore = 3
            };

            string result = tennisGame.GetScore();

            Console.WriteLine(result);
        }
コード例 #4
0
ファイル: TennisGameTests.cs プロジェクト: HoschiS/Katas
 public void Test_TwoScoresEach_CountIsThirtyToThirty()
 {
     var game = new TennisGame();
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_B);
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_B);
     Ashure.That(game.GetScore().Equals("30:30"));
 }
コード例 #5
0
ファイル: TennisGameTests.cs プロジェクト: HoschiS/Katas
 public void Test_TwoScorePlayerB_CountIsZeroToThirty()
 {
     var game = new TennisGame();
     game.ScorePoint(TennisGame.PLAYER_B);
     game.ScorePoint(TennisGame.PLAYER_B);
     Ashure.That(game.GetScore().Equals("0:30"));
 }
コード例 #6
0
ファイル: TennisGameTests.cs プロジェクト: HoschiS/Katas
 public void Test_TwoScorePlayerA_CountIsThirtyToZero()
 {
     var game = new TennisGame();
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_A);
     Ashure.That(game.GetScore().Equals("30:0"));
 }
コード例 #7
0
ファイル: TennisGameTests.cs プロジェクト: HoschiS/Katas
 public void Test_ThreeScoresEach_CountIsDeuce()
 {
     var game = new TennisGame();
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_B);
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_B);
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_B);
     Ashure.That(game.GetScore().Equals(TennisGame.DEUCE));
 }
コード例 #8
0
ファイル: TennisGameTests.cs プロジェクト: HoschiS/Katas
 public void Test_OneScorePlayerB_CountIsZeroToFiveteen()
 {
     var game = new TennisGame();
     game.ScorePoint(TennisGame.PLAYER_B);
     Ashure.That(game.GetScore().Equals("0:15"));
 }
コード例 #9
0
ファイル: TennisGameTests.cs プロジェクト: HoschiS/Katas
 public void Test_OneScorePlayerA_CountIsFiveteenToZero()
 {
     var game = new TennisGame();
     game.ScorePoint(TennisGame.PLAYER_A);
     Ashure.That(game.GetScore().Equals("15:0"));
 }
コード例 #10
0
ファイル: TennisGameTests.cs プロジェクト: HoschiS/Katas
 public void Test_OneScoreEach_CountIsFiveteenToFiveteen()
 {
     var game = new TennisGame();
     game.ScorePoint(TennisGame.PLAYER_A);
     game.ScorePoint(TennisGame.PLAYER_B);
     Ashure.That(game.GetScore().Equals("15:15"));
 }
コード例 #11
0
ファイル: TennisGameTests.cs プロジェクト: HoschiS/Katas
 public void Test_NoScores_CountIsZeroToZero()
 {
     var game = new TennisGame();
     Ashure.That(game.GetScore().Equals("0:0"));
 }
コード例 #12
0
        public void LoveAll()
        {
            var score = _tennisGame.GetScore();

            Assert.AreEqual("Love_All", score);
        }