Пример #1
0
        public DbContextFactory()
        {
            var builder = new DbContextOptionsBuilder <PaninApiDbContext>();

            builder.UseInMemoryDatabase(Guid.NewGuid().ToString()).ConfigureWarnings(configurationBuilder =>
                                                                                     configurationBuilder.Ignore(InMemoryEventId.TransactionIgnoredWarning));

            Options = builder.Options;

            DbContext = new PaninApiDbContext(Options);
        }
Пример #2
0

        
Пример #3
0
 public StudentService(PaninApiDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Пример #4
0

        
 public BarmanHandlerTests()
 {
     _dbContext  = new DbContextFactory().DbContext;
     _loggerMock = new Mock <ILogger <BarmanHandler> >();
     _handler    = new BarmanHandler(_dbContext, _loggerMock.Object);
 }
 public CoffeeShopService(PaninApiDbContext dbContext)
 {
     _dbContext = dbContext;
 }