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); } }
private ErrorCentralContext Seed() { var context = new ErrorCentralContext(Options); context.Database.EnsureDeleted(); context.Database.EnsureCreated(); context.Add(_user); context.SaveChanges(); return(context); }
private ErrorCentralContext Seed() { var context = new ErrorCentralContext(Options); context.Database.EnsureDeleted(); context.Database.EnsureCreated(); context.Add(new UserBuilder().Build()); context.SaveChanges(); context.AddRange(_logErrors[0], _logErrors[1]); context.SaveChanges(); return(context); }
public UserRepository(ErrorCentralContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }