public void Love_Thirty() { var gameId = 1; IRepository <Game> repo = Substitute.For <IRepository <Game> >(); repo.GetGame(gameId).Returns(new Game { Id = gameId, FirstPlayerScore = 0, SecondPlayerScore = 2 }); TennisGame tennisGame = new TennisGame(repo); var scoreResult = tennisGame.ScoreResult(gameId); Assert.AreEqual("Love Thirty", scoreResult); }
public void Deuce_when4to4() { var gameId = 1; IRepository <Game> repo = Substitute.For <IRepository <Game> >(); repo.GetGame(gameId).Returns(new Game { Id = gameId, FirstPlayerScore = 4, SecondPlayerScore = 4 }); TennisGame tennisGame = new TennisGame(repo); var scoreResult = tennisGame.ScoreResult(gameId); Assert.AreEqual("Deuce", scoreResult); }
public void Joey_win() { var gameId = 1; IRepository <Game> repo = Substitute.For <IRepository <Game> >(); repo.GetGame(gameId).Returns(new Game { Id = gameId, FirstPlayerScore = 5, SecondPlayerScore = 3 }); TennisGame tennisGame = new TennisGame(repo); var scoreResult = tennisGame.ScoreResult(gameId); Assert.AreEqual("Joey Win", scoreResult); }
public void Fifteen_All() { var gameId = 1; IRepository <Game> repo = Substitute.For <IRepository <Game> >(); repo.GetGame(gameId).Returns(new Game { Id = gameId, FirstPlayerScore = 1, SecondPlayerScore = 1 }); TennisGame tennisGame = new TennisGame(repo); var scoreResult = tennisGame.ScoreResult(gameId); Assert.AreEqual("Fifteen All", scoreResult); }