public void Test1515() { Game game = new Game(); game.PlayerOneWinsPoint(); game.PlayerTwoWinsPoint(); Assert.AreEqual("15 all", game.Score()); }
public Controller() { Game = new Game(); Player1Name = "Bart"; Player2Name = "Stefan"; CreateScoreBoard(); }
public void Intermezzo_ScoringWhenAWinnerThrows2() { var game = new Game(); game.Player1Scores(); game.Player1Scores(); game.Player1Scores(); game.Player1Scores(); Assert.Throws<InvalidOperationException>(game.Player2Scores); }
private void InitializeCurrentGame() { if (playerTwoGames == playerOneGames && playerOneGames == 6) currentGame = new Tiebreak(); else currentGame = new Game(); currentGame.PlayerOneWins += PlayerOneWinsGame; currentGame.PlayerTwoWins += PlayerTwoWinsGame; }
public void TestDeuce() { Game game = new Game(); for (int i = 0; i < 5; i++) { game.PlayerOneWinsPoint(); game.PlayerTwoWinsPoint(); } Assert.AreEqual("deuce", game.Score()); }
public void Test3030() { Game game = new Game(); for (int i = 0; i < 2; i++) { game.PlayerOneWinsPoint(); game.PlayerTwoWinsPoint(); } Assert.AreEqual("30 all", game.Score()); }
public void TestAdvP2() { Game game = new Game(); for (int i = 0; i < 3; i++) { game.PlayerOneWinsPoint(); game.PlayerTwoWinsPoint(); } game.PlayerTwoWinsPoint(); Assert.AreEqual("advantage player two", game.Score()); }
public void Deuce_ScoreDeuce() { const string expected = "deuce"; var game = new Game(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); var actual = game.ScoreString; Assert.AreEqual(expected, actual); }
public void AdvantagePlayer1_ScoreAD_40() { const string expected = "AD-40"; var game = new Game(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); var actual = game.ScoreString; Assert.AreEqual(expected, actual); }
public void SecondAdvantagePlayer2_Score40_AD() { const string expected = "40-AD"; var game = new Game(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); var actual = game.ScoreString; Assert.AreEqual(expected, actual); }
public void Player2LoveGame_Player2Wins() { const int expected = 2; var game = new Game(); game.Player2Scores(); game.Player2Scores(); game.Player2Scores(); game.Player2Scores(); var actual = game.Winner; Assert.AreEqual(expected, actual); }
public void Player2LoveGame_AWinner() { const bool expected = true; var game = new Game(); game.Player2Scores(); game.Player2Scores(); game.Player2Scores(); game.Player2Scores(); var actual = game.HasWinner; Assert.AreEqual(expected, actual); }
public void Player1Scores_Score15_0() { var game = new Game(); const string expected = "15-0"; game.Player1Scores(); var actual = game.ScoreString; Assert.AreEqual(expected, actual); }
public void TestTripleGamePoint() { Game game = new Game(); for (int i = 0; i < 3; i++) { game.PlayerOneWinsPoint(); } Assert.AreEqual("40 - love", game.Score()); }
public void Intermezzo_ThrowWhenRequestingWinnerIfNoWinner() { var game = new Game(); Assert.Throws<InvalidOperationException>(() => { var irrelevant = game.Winner; }); }
public void TestLoveAll() { Game game = new Game(); Assert.AreEqual("love all", game.Score()); }
public void TestGameOver() { Game game = new Game(); game.PlayerTwoWinsPoint(); game.PlayerOneWinsPoint(); game.PlayerTwoWinsPoint(); game.PlayerTwoWinsPoint(); game.PlayerTwoWinsPoint(); Assert.AreEqual(true, game.GameOver); }
public void NewGame_Score0_0() { const string expected = "0-0"; var actual = new Game().ScoreString; Assert.AreEqual(expected, actual); }
public void SetUp() { m_Game = new Game(); m_Player1Name = "Timo"; m_Player2Name = "Stefan"; }
public void TestP2Wins() { Game game = new Game(); for (int i = 0; i < 3; i++) { game.PlayerOneWinsPoint(); game.PlayerTwoWinsPoint(); } game.PlayerTwoWinsPoint(); game.PlayerTwoWinsPoint(); Assert.AreEqual("player two wins", game.Score()); }
public void NewGame_NoWinner() { const bool expected = false; var actual = new Game().HasWinner; Assert.AreEqual(expected, actual); }
public ScoreBoard(Game game, string player1Name, string player2Name) { m_Game = game; m_PlayerNames = new[] {player1Name, player2Name}; }
public void Player1Advantage_NoWinner() { const bool expected = false; var game = new Game(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); game.Player2Scores(); game.Player1Scores(); var actual = game.HasWinner; Assert.AreEqual(expected, actual); }
public void Player1ScoresThrice_Player2ScoresOnce_Score40_15() { var game = new Game(); const string expected = "40-15"; game.Player1Scores(); game.Player1Scores(); game.Player1Scores(); game.Player2Scores(); var actual = game.ScoreString; Assert.AreEqual(expected, actual); }