Example #1
0
 public void PlayerOne_should_not_wins_on_less_than_5_scores()
 {
     var game = new TennisGame();
     game.Win(game.PlayerOne);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerOne);
     Assert.That(game.Finished, Is.False);
 }
Example #2
0
 public void PlayerOne_should_wins_on_5_scores()
 {
     var game = new TennisGame();
     game.Win(game.PlayerOne);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerOne);
     Assert.That(game.Finished, Is.True);
 }
Example #3
0
 public void Game_should_finished_with_2_wins_on_fouty_fouty()
 {
     var game = new TennisGame();
     game.Win(game.PlayerOne);
     game.Win(game.PlayerTwo);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerTwo);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerTwo);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerOne);
     Assert.That(game.PlayerOne.Points, Is.EqualTo(Points.Game));
     Assert.That(game.Finished, Is.True);
 }
Example #4
0
 public void Game_should_swaped_advantage_and_game_should_not_finished_()
 {
     var game = new TennisGame();
     game.Win(game.PlayerOne);
     game.Win(game.PlayerTwo);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerTwo);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerTwo);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerTwo);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerTwo);
     game.Win(game.PlayerOne);
     game.Win(game.PlayerTwo);
     Assert.That(game.PlayerOne.Points, Is.EqualTo(Points.Forty));
     Assert.That(game.Finished, Is.False);
 }