public void Archive_log_error_sucess() { // Arrange var logError = new LogErrorBuilder().Build(); // Act logError.Archive(); logError.Filed.Should().BeTrue(); }
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 void Create_log_error_success() { //Arrange var builder = new LogErrorBuilder(); //Act var logError = builder.Build(); //Assert logError .Should() .NotBeNull(); logError.UserId .Should() .Be(builder.UserId); logError.Removed .Should() .BeFalse(); logError.Filed .Should() .BeFalse(); logError.Level .Should() .NotBeNull(); logError.Environment .Should() .NotBeNull(); logError.CreatedAt .Should() .BeAfter(1.Hours().Before(DateTime.UtcNow)); logError.UpdatedAt .Should() .BeAfter(1.Hours().Before(DateTime.UtcNow)); }