public void CreatesMatch() { var repository = Repository.CreatePopulatedRepository(); var service = new MatchService(repository, new Mock<IMailService>().Object); var matchCount = repository.Matches.Count(); service.CreateMatch(1, "User1", "User2"); Assert.That(repository.Matches.Count(), Is.EqualTo(matchCount + 1)); }
public void ThrowsIfBoardNotStarted() { var repository = Repository.CreatePopulatedRepository(); var service = new MatchService(repository, new Mock<IMailService>().Object); var board = repository.GetBoardById(1); board.Started = DateTime.Now.AddDays(5); Assert.Throws<ServiceException>(() => service.CreateMatch(1, "User1", "User2")); }