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); }
public StudentService(PaninApiDbContext dbContext) { _dbContext = dbContext; }
public BarmanHandlerTests() { _dbContext = new DbContextFactory().DbContext; _loggerMock = new Mock <ILogger <BarmanHandler> >(); _handler = new BarmanHandler(_dbContext, _loggerMock.Object); }
public CoffeeShopService(PaninApiDbContext dbContext) { _dbContext = dbContext; }