예제 #1
0
        public void GetTennisResult_Player1_score_5_Player_score_4_Result_Player1_Deuce2()
        {
            AddTwoPlayers(3, 4, "Player1", "Player2");

            var gameScoreboard = new GameScoreBoard(_firstPlayer, _secondPlayer);

            // Deuce1
            var gameResult = gameScoreboard.GetGameResult();

            _firstPlayer.Score = _firstPlayer.Score + 2;

            // Deuce2
            gameResult = gameScoreboard.GetGameResult();

            // assert
            Assert.AreEqual("Player1 Deuce2", gameResult);
        }
예제 #2
0
        private static void GameResultShouldBe(string expected, TennisPlayer _firstPlayer, TennisPlayer _secondPlayer)
        {
            var gameScoreboard = new GameScoreBoard(_firstPlayer, _secondPlayer);

            // act
            var gameResult = gameScoreboard.GetGameResult();

            // assert
            Assert.AreEqual(expected, gameResult);
        }