public void FinishGame_Remove_DecreaseCount() { var scoreBoard = ScoreBoardInitializer(); var countBeforeFinishGame = scoreBoard.Games.Count(); var game = new Game() { Id = 3, HomeTeam = new HomeTeam() { Name = "Tarragona" }, AwayTeam = new AwayTeam() { Name = "Murcia" } }; var GameFinisher = new GameFinisher(scoreBoard); GameFinisher.FinishGame(game); Assert.Equal(countBeforeFinishGame - 1, scoreBoard.Games.Count); }
public void FinishGame_NotFoundGame_SameCount() { var scoreBoard = ScoreBoardInitializer(); var countBeforeFinishGame = scoreBoard.Games.Count(); var game = new Game() { Id = 5, HomeTeam = new HomeTeam() { Name = "Alicante" }, AwayTeam = new AwayTeam() { Name = "Valencia" } }; var GameFinisher = new GameFinisher(scoreBoard); GameFinisher.FinishGame(game); Assert.Equal(countBeforeFinishGame, scoreBoard.Games.Count); }
public void FinishGame_Game_Null_Throws() { var scoreBoard = Mock.Of <ScoreBoard>(); var gameFinisher = new GameFinisher(scoreBoard); Action action = () => gameFinisher.FinishGame(null); action.Should().Throw <ArgumentNullException>(); }