Пример #1
0
        public string PostRegistrarEntrada(EntradaProductoRequest request)
        {
            var service  = new RegistrarEntradaProductoService(_unitOfWork, _productoRepository);
            var response = service.Handle(request);

            return(response);
        }
        public void Setup()
        {
            var optionsSqlite = new DbContextOptionsBuilder <InventarioContext>()
                                .UseSqlite(SqlLiteDatabaseInMemory.CreateConnection())
                                .Options;

            _dbContext = new InventarioContext(optionsSqlite);
            _dbContext.Database.EnsureDeleted();
            _dbContext.Database.EnsureCreated();
            _productoRepository = new ProductoRepository(_dbContext);

            var mockEmailServer = new Mock <IMailServer>();

            _registrarEntadaProductoService = new RegistrarEntradaProductoService(
                new UnitOfWork(_dbContext),
                _productoRepository
                );
        }
Пример #3
0
        public void Setup()
        {
            var optionsSqlite = new DbContextOptionsBuilder <InventarioContext>()
                                .UseSqlite(@"Data Source=C:\\sqlite\\InventarioDBTest.db")
                                .Options;

            _dbContext = new InventarioContext(optionsSqlite);
            _dbContext.Database.EnsureDeleted();
            _dbContext.Database.EnsureCreated();
            _productoRepository = new ProductoRepository(_dbContext);

            var mockEmailServer = new Mock <IMailServer>();

            _registrarEntadaProductoService = new RegistrarEntradaProductoService(
                new UnitOfWork(_dbContext),
                _productoRepository
                );
        }