Esempio n. 1
0
 public void Given2Players_When_Player1MakesFourPointsDirectly_Then_ScoreIs_wins_player_one()
 {
     var game = new TennisGame();
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.One);
     Assert.That(game.Score(), Is.EqualTo("wins player one"));
 }
        public void ScoreShouldBeDisplayedCorrectly(int p1Score, int p2Score, string expectedScore)
        {
            var game = new TennisGame("player1", "player2");

            ScorePoints(game, "player1", p1Score);
            ScorePoints(game, "player2", p2Score);

            var actualScore = game.GetScore();

            Assert.AreEqual(expectedScore, actualScore);
        }
Esempio n. 3
0
 public void Given2Players_When_Player1MakesThreePointsAndPlayer2MakesFourPointsAlternately_Then_ScoreIs_advantage_player_two()
 {
     var game = new TennisGame();
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.Two);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.Two);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.Two);
     game.MakesAPoint(Player.Two);
     Assert.That(game.Score(), Is.EqualTo("advantage player two"));
 }
Esempio n. 4
0
 public void Given2Players_When_Player1MakesFivePointsAndPlayer2MakesThreePointsAlternately_Then_ScoreIs_wins_player_one()
 {
     var game = new TennisGame();
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.Two);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.Two);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.Two);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.One);
     Assert.That(game.Score(), Is.EqualTo("wins player one"));
 }
Esempio n. 5
0
 public void Given2Players_When_Player1MakesThreePointsAndPlayer2MakesOnePoint_Then_ScoreIs_forty_fifteen()
 {
     var game = new TennisGame();
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.Two);
     Assert.That(game.Score(), Is.EqualTo("forty-fifteen"));
 }
Esempio n. 6
0
 public void Given2Players_When_Player1MakesAPoint_Then_ScoreIs_fifteen_love()
 {
     var game = new TennisGame();
     game.MakesAPoint(Player.One);
     Assert.That(game.Score(), Is.EqualTo("fifteen-love"));
 }
Esempio n. 7
0
 public void Given2Players_When_Player1MakesTwoPoints_Then_ScoreIs_thirty_love()
 {
     var game = new TennisGame();
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.One);
     Assert.That(game.Score(), Is.EqualTo("thirty-love"));
 }
Esempio n. 8
0
 public void Given2Players_When_Player1MakesThreePointsAndPlayer2MakesThreePoints_Then_ScoreIs_deuce()
 {
     var game = new TennisGame();
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.One);
     game.MakesAPoint(Player.Two);
     game.MakesAPoint(Player.Two);
     game.MakesAPoint(Player.Two);
     Assert.That(game.Score(), Is.EqualTo("deuce"));
 }
Esempio n. 9
0
 public void Given2Players_When_GameIsStarting_Then_ScoreIs_love()
 {
     var game = new TennisGame();
     Assert.That(game.Score(), Is.EqualTo("love"));
 }
Esempio n. 10
0
 public void setup()
 {
     guiMock    = new Mock <ITennisGui>();
     tennisGame = new TennisGame(guiMock.Object);
 }