public async Task Atualizar_test() { //Given(Preparação) using var dbconnection = await new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider).OpenAsync(); var baseRepositoryMock = new PedidosRepository(dbconnection); dbconnection.CreateTableIfNotExists <Pedido>(); var expectresult = _faker.Generate <Pedido>(); await dbconnection.InsertAsync(expectresult); expectresult.Peso = 1; var param = expectresult.ConvertTo <PedidoEntity>(); //When await baseRepositoryMock.Atualizar(param); var result = await dbconnection.SingleAsync <Pedido>(p => p.Id == expectresult.Id); //Then Assert.True(_comparison.Compare(result, expectresult).AreEqual); }
public async Task GetByDroneIDAndStatus_test() { //Given(Preparação) using var dbconnection = await new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider).OpenAsync(); var baseRepositoryMock = new PedidosRepository(dbconnection); dbconnection.CreateTableIfNotExists <Pedido>(); var param1 = Guid.NewGuid(); var param2 = PedidoStatus.Entregue; var expectresult = new AutoFaker <Pedido>() .RuleFor(fake => fake.DroneId, fake => param1) .RuleFor(fake => fake.Status, fake => PedidoStatus.Entregue.ToString()) .Generate(3); await dbconnection.InsertAllAsync(expectresult); //When var result = await baseRepositoryMock.GetByDroneIDAndStatus(param1, param2); //Then Assert.True(_comparison.Compare(result.ConvertTo <List <Pedido> >(), expectresult).AreEqual); }
public PedidosController(IConfiguration configuration) { PedidosRepository = new PedidosRepository(configuration); ClientesRepository = new ClientesRepository(configuration); StatusRepository = new StatusRepository(configuration); FormapagamentosRepository = new FormapagamentosRepository(configuration); }
public UnitOfWork(LojaEntities context) { _context = context; Clientes = new ClientesRepository(_context); ItensPedidos = new ItensPedidosRepository(_context); Pedidos = new PedidosRepository(_context); Produtos = new ProdutosRepository(_context); Sp_Sel_Pedidos = new Sp_Loja_Sel_Pedidos <SP_LOJA_SEL_PEDIDOS_Result>(_context); }
public FisiotesService() { _ctx = new FisiotesContext(); Clientes = new ClientesRepository(_ctx); Huecos = new HuecosRepository(_ctx); PuntosPendientes = new PuntosPendientesRepository(_ctx); Configuraciones = new ConfiguracionesRepository(_ctx); Entregas = new EntregasRepository(_ctx); Medicamentos = new MedicamentosRepository(_ctx); Sinonimos = new SinonimosRepository(_ctx); Pedidos = new PedidosRepository(_ctx); Listas = new ListasRepository(_ctx); Categorias = new CategoriasRepository(_ctx); Encargos = new EncargosRepository(_ctx); Familias = new FamiliasRepository(_ctx); Faltas = new FaltasRepository(_ctx); }
public FarmaticService() { _ctx = new FarmaticContext(); Clientes = new ClientesRepository(_ctx); Destinatarios = new DestinatariosRepository(_ctx); Vendedores = new VendedoresRepository(_ctx); Ventas = new VentasRepository(_ctx); Articulos = new ArticulosRepository(_ctx); Proveedores = new ProveedoresRepository(_ctx); Sinonimos = new SinonimosRepository(_ctx); Familias = new FamiliasRepository(_ctx); Laboratorios = new LaboratoriosRepository(_ctx); Recepciones = new RecepcionesRepository(_ctx); ListasArticulos = new ListasArticulosRepository(_ctx); Encargos = new EncargosRepository(_ctx); Pedidos = new PedidosRepository(_ctx); }
public FisiotesService(string host, string token) { Clientes = new ClientesRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Huecos = new HuecosRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); PuntosPendientes = new PuntosPendientesRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Configuraciones = new ConfiguracionesRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Entregas = new EntregasRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Medicamentos = new MedicamentosRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Sinonimos = new SinonimosRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Pedidos = new PedidosRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Faltas = new FaltasRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Familias = new FamiliasRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Encargos = new EncargosRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Categorias = new CategoriasRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Listas = new ListasRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Proveedores = new ProveedoresRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); Programacion = new ProgramacionRepository(new RestClient.RestSharp.RestClient(), FisiotesConfig.TestConfig(host, token)); }
public FarmaticService(LocalConfig config) { _config = config ?? throw new ArgumentNullException(nameof(config)); Clientes = new ClientesRepository(_config); Destinatarios = new DestinatariosRepository(_config); Vendedores = new VendedoresRepository(_config); Ventas = new VentasRepository(_config); Articulos = new ArticulosRepository(_config); Proveedores = new ProveedoresRepository(_config); Sinonimos = new SinonimosRepository(_config); Familias = new FamiliasRepository(_config); Laboratorios = new LaboratoriosRepository(_config); Recepciones = new RecepcionesRepository(_config); ListasArticulos = new ListasArticulosRepository(_config); Encargos = new EncargosRepository(_config); Pedidos = new PedidosRepository(_config); }
public async Task GetAll_test() { //Given(Preparação) using var dbconnection = await new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider).OpenAsync(); var baseRepositoryMock = new PedidosRepository(dbconnection); dbconnection.CreateTableIfNotExists <Pedido>(); var expectresult = _faker.Generate <Pedido>(4); await dbconnection.InsertAllAsync(expectresult); //When var result = await baseRepositoryMock.GetAll(); //Then Assert.True(_comparison.Compare(result.ConvertTo <List <Pedido> >(), expectresult).AreEqual); }
public ItenspedidosController(IConfiguration configuration) { ItenspedidosRepository = new ItenspedidosRepository(configuration); ProdutosRepository = new ProdutosRepository(configuration); PedidosRepository = new PedidosRepository(configuration); }
public PedidosController(PedidosRepository repo) { this.repo = repo; }