public void Setup() { //Arrange var optionsSqlite = new DbContextOptionsBuilder <RestauranteHotelContext>() .UseSqlite(SqlLiteDatabaseInMemory.CreateConnection()) .Options; _dbContext = new RestauranteHotelContext(optionsSqlite); _dbContext.Database.EnsureDeleted(); _dbContext.Database.EnsureCreated(); _entradaProductoSimpleService = new EntradaProductoSimpleService( new UnitOfWork(_dbContext), new ProductoSimpleRepository(_dbContext)); }
public void Setup() { //Arrange var optionsSqlite = new DbContextOptionsBuilder <RestauranteHotelContext>() .UseSqlite(@"Data Source=RestauranteHotelDataBaseTest.db") .Options; _dbContext = new RestauranteHotelContext(optionsSqlite); _dbContext.Database.EnsureDeleted(); _dbContext.Database.EnsureCreated(); _salidaProductoCompuestoService = new SalidaProductoCompuestoService( new UnitOfWork(_dbContext), new ProductoCompuestoRepository(_dbContext)); }