Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        private ErrorCentralContext Seed()
        {
            var context = new ErrorCentralContext(Options);

            context.Database.EnsureDeleted();
            context.Database.EnsureCreated();

            context.Add(_user);

            context.SaveChanges();

            return(context);
        }
Exemplo n.º 3
0
        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));
 }