public async void Add_LogError() { using (var context = new ErrorCentralContext(Options)) { var logError = new LogErrorBuilder().Build(); var repository = new LogErrorRepository(context); LogError result = await repository.AddAsync(logError); result.Should().BeEquivalentTo(logError); } }
public async void GetList_LogError() { using (var context = Seed()) { LogErrorBuilder builder = new LogErrorBuilder(); var repository = new LogErrorRepository(context); IList <LogError> result = await repository.GetAllUnarchivedAsync(); result.Should().BeEquivalentTo(_logErrors); } }
public async void GetByEnvironment_LogError() { using (var context = Seed()) { var repository = new LogErrorRepository(context); IList <LogError> result = await repository.GetByEnvironmentAsync(EEnvironment.Production); foreach (LogError logError in result) { logError.Environment.Should().Be(EEnvironment.Production); } } }
public async void Update_LogError() { using (var context = Seed()) { var repository = new LogErrorRepository(context); LogError result = await repository.GetByIdAsync(1); result.Archive(); repository.Update(result); int updated = await repository.UnitOfWork.SaveChangesAsync(); updated.Should().BeGreaterThan(0); } }