public void GetEntities_HappyPath() { // Arrange var dbContext = A.Fake <ProFootballEntities>(); var repository = new TeamSeasonRepository(dbContext); // Act var result = repository.GetEntities(); // Assert Assert.IsInstanceOf <IEnumerable <TeamSeason> >(result); }
public void GetEntities_ExceptionCaught_LogsAndRethrowsException() { // Arrange var dbContext = A.Fake <ProFootballEntities>(); var repository = new TeamSeasonRepository(dbContext); A.CallTo(() => dbContext.TeamSeasons).Throws <Exception>(); // Act IEnumerable <TeamSeason> result = null; Assert.Throws <Exception>(() => result = repository.GetEntities()); // Assert Assert.IsNull(result); }