public void SeleccionarFacturaElectronica() { SimpleFactContext context = new SimpleFactContext(); SimpleFactContext context2 = new SimpleFactContext(); IGenericRepository <ServicioFacturaElectronica> Interface_facturaElectronica = new GenericRepository <ServicioFacturaElectronica>(context); IGenericRepository <LogErrores> Interface_logErrores = new GenericRepository <LogErrores>(context2); MantenimientoFacturaElectronica mantePersona = new MantenimientoFacturaElectronica(Interface_facturaElectronica, Interface_logErrores); //var ListaP = mantePersona.BuscarPersonaPorCedula("1234"); //Assert.AreEqual(ListaP[0].Identificacion, "1234"); }
public void InsertarPersona_ConInformacionNoValida() { SimpleFactContext context = new SimpleFactContext(); SimpleFactContext context2 = new SimpleFactContext(); IGenericRepository <Ubicacion> Interface_ubicacion = new GenericRepository <Ubicacion>(context); IGenericRepository <Persona> Interface_persona = new GenericRepository <Persona>(context); IGenericRepository <TipoFigura> Interface_tipoFigura = new GenericRepository <TipoFigura>(context); IGenericRepository <TipoCedula> Interface_tipoCedula = new GenericRepository <TipoCedula>(context); IGenericRepository <LogErrores> Interface_logErrores = new GenericRepository <LogErrores>(context2); MantenimientoPersona mantePersona = new MantenimientoPersona(Interface_persona, Interface_ubicacion, Interface_tipoFigura, Interface_logErrores, Interface_tipoCedula); var res = mantePersona.AgregarPersona(15, 1, 1, "112410464", "Persona Test" + DateTime.Now.Day, "", "*****@*****.**", new DateTime(1985, 5, 12), "506", "87122797", null, null, "Otras sennas", true, true); Assert.IsNull(res); }
public void BuscarPersonaPorCedula_CedulaValida() { SimpleFactContext context = new SimpleFactContext(); SimpleFactContext context2 = new SimpleFactContext(); IGenericRepository <Ubicacion> Interface_ubicacion = new GenericRepository <Ubicacion>(context); IGenericRepository <Persona> Interface_persona = new GenericRepository <Persona>(context); IGenericRepository <TipoFigura> Interface_tipoFigura = new GenericRepository <TipoFigura>(context); IGenericRepository <TipoCedula> Interface_tipoCedula = new GenericRepository <TipoCedula>(context); IGenericRepository <LogErrores> Interface_logErrores = new GenericRepository <LogErrores>(context2); MantenimientoPersona mantePersona = new MantenimientoPersona(Interface_persona, Interface_ubicacion, Interface_tipoFigura, Interface_logErrores, Interface_tipoCedula); var ListaP = mantePersona.BuscarPersonaPorCedula("1234"); Assert.AreEqual(ListaP[0].Identificacion, "1234"); }
public void SeleccionarTipoFigura_CuandoExistenDatosActivos() { SimpleFactContext context = new SimpleFactContext(); SimpleFactContext context2 = new SimpleFactContext(); IGenericRepository <Ubicacion> Interface_ubicacion = new GenericRepository <Ubicacion>(context); IGenericRepository <Persona> Interface_persona = new GenericRepository <Persona>(context); IGenericRepository <TipoFigura> Interface_tipoFigura = new GenericRepository <TipoFigura>(context); IGenericRepository <TipoCedula> Interface_tipoCedula = new GenericRepository <TipoCedula>(context); IGenericRepository <LogErrores> Interface_logErrores = new GenericRepository <LogErrores>(context2); MantenimientoPersona mantePersona = new MantenimientoPersona(Interface_persona, Interface_ubicacion, Interface_tipoFigura, Interface_logErrores, Interface_tipoCedula); var ListaP = mantePersona.SeleccionarTipoFigura(); Assert.IsNotNull(ListaP); }
public void BuscarProveedoresCuandoHayRegistrosActivos() { SimpleFactContext context = new SimpleFactContext(); SimpleFactContext context2 = new SimpleFactContext(); IGenericRepository <Producto> Interface_productos = new GenericRepository <Producto>(context); IGenericRepository <Persona> Interface_persona = new GenericRepository <Persona>(context); IGenericRepository <ProductoCategoria> Interface_categoriaProducto = new GenericRepository <ProductoCategoria>(context); IGenericRepository <TipoUnidadesMedida> Interface_unidadMedida = new GenericRepository <TipoUnidadesMedida>(context); IGenericRepository <TipoImpuestos> Interface_impuestos = new GenericRepository <TipoImpuestos>(context); IGenericRepository <TipoExoneraciones> Interface_exoneraciones = new GenericRepository <TipoExoneraciones>(context); IGenericRepository <MovimientosInventario> Interface_movimientoInventario = new GenericRepository <MovimientosInventario>(context); IGenericRepository <RazonMovimientoInventario> Interface_razonesMovInventario = new GenericRepository <RazonMovimientoInventario>(context); IGenericRepository <LogErrores> Interface_logErrores = new GenericRepository <LogErrores>(context2); MantenimientoProducto manteprod = new MantenimientoProducto(Interface_productos, Interface_persona, Interface_categoriaProducto, Interface_unidadMedida, Interface_impuestos, Interface_exoneraciones, Interface_movimientoInventario, Interface_razonesMovInventario, Interface_logErrores); var listaP = manteprod.SeleccionarProveedores(); Assert.IsNotNull(listaP); }
public void BuscarProductoXCodigoQueNoExiste() { SimpleFactContext context = new SimpleFactContext(); SimpleFactContext context2 = new SimpleFactContext(); IGenericRepository <Producto> Interface_productos = new GenericRepository <Producto>(context); IGenericRepository <Persona> Interface_persona = new GenericRepository <Persona>(context); IGenericRepository <ProductoCategoria> Interface_categoriaProducto = new GenericRepository <ProductoCategoria>(context); IGenericRepository <TipoUnidadesMedida> Interface_unidadMedida = new GenericRepository <TipoUnidadesMedida>(context); IGenericRepository <TipoImpuestos> Interface_impuestos = new GenericRepository <TipoImpuestos>(context); IGenericRepository <TipoExoneraciones> Interface_exoneraciones = new GenericRepository <TipoExoneraciones>(context); IGenericRepository <MovimientosInventario> Interface_movimientoInventario = new GenericRepository <MovimientosInventario>(context); IGenericRepository <RazonMovimientoInventario> Interface_razonesMovInventario = new GenericRepository <RazonMovimientoInventario>(context); IGenericRepository <LogErrores> Interface_logErrores = new GenericRepository <LogErrores>(context2); MantenimientoProducto manteprod = new MantenimientoProducto(Interface_productos, Interface_persona, Interface_categoriaProducto, Interface_unidadMedida, Interface_impuestos, Interface_exoneraciones, Interface_movimientoInventario, Interface_razonesMovInventario, Interface_logErrores); var listaP = manteprod.BuscarProductoPorCodigo("5"); Assert.AreEqual(listaP.Count, 0); }
public void InsertarProducto_ConCategoriaQueNoExiste() { SimpleFactContext context = new SimpleFactContext(); SimpleFactContext context2 = new SimpleFactContext(); IGenericRepository <Producto> Interface_productos = new GenericRepository <Producto>(context); IGenericRepository <Persona> Interface_persona = new GenericRepository <Persona>(context); IGenericRepository <ProductoCategoria> Interface_categoriaProducto = new GenericRepository <ProductoCategoria>(context); IGenericRepository <TipoUnidadesMedida> Interface_unidadMedida = new GenericRepository <TipoUnidadesMedida>(context); IGenericRepository <TipoImpuestos> Interface_impuestos = new GenericRepository <TipoImpuestos>(context); IGenericRepository <TipoExoneraciones> Interface_exoneraciones = new GenericRepository <TipoExoneraciones>(context); IGenericRepository <MovimientosInventario> Interface_movimientoInventario = new GenericRepository <MovimientosInventario>(context); IGenericRepository <RazonMovimientoInventario> Interface_razonesMovInventario = new GenericRepository <RazonMovimientoInventario>(context); IGenericRepository <LogErrores> Interface_logErrores = new GenericRepository <LogErrores>(context2); MantenimientoProducto manteprod = new MantenimientoProducto(Interface_productos, Interface_persona, Interface_categoriaProducto, Interface_unidadMedida, Interface_impuestos, Interface_exoneraciones, Interface_movimientoInventario, Interface_razonesMovInventario, Interface_logErrores); Producto res = manteprod.IngresarProducto(13, 1, 1, null, 1, "Nombre Prod 3", "detalle prod 3", 2, 120, 60, "20", DateTime.Now, "1", true); Assert.IsNull(res); }
public void Insertar_MovimientosInventario_InformacionValida() { SimpleFactContext context = new SimpleFactContext(); SimpleFactContext context2 = new SimpleFactContext(); IGenericRepository <Producto> Interface_productos = new GenericRepository <Producto>(context); IGenericRepository <Persona> Interface_persona = new GenericRepository <Persona>(context); IGenericRepository <ProductoCategoria> Interface_categoriaProducto = new GenericRepository <ProductoCategoria>(context); IGenericRepository <TipoUnidadesMedida> Interface_unidadMedida = new GenericRepository <TipoUnidadesMedida>(context); IGenericRepository <TipoImpuestos> Interface_impuestos = new GenericRepository <TipoImpuestos>(context); IGenericRepository <TipoExoneraciones> Interface_exoneraciones = new GenericRepository <TipoExoneraciones>(context); IGenericRepository <MovimientosInventario> Interface_movimientoInventario = new GenericRepository <MovimientosInventario>(context); IGenericRepository <RazonMovimientoInventario> Interface_razonesMovInventario = new GenericRepository <RazonMovimientoInventario>(context); IGenericRepository <LogErrores> Interface_logErrores = new GenericRepository <LogErrores>(context2); MantenimientoProducto manteprod = new MantenimientoProducto(Interface_productos, Interface_persona, Interface_categoriaProducto, Interface_unidadMedida, Interface_impuestos, Interface_exoneraciones, Interface_movimientoInventario, Interface_razonesMovInventario, Interface_logErrores); var listaE = manteprod.InsertarMovimientosInventario(25, 1, 25, "165afcbc-8364-4bd5-959f-b65e1bd08554", TipoMovimiento.Ingreso.ToString()); Assert.IsNotNull(listaE); }
public void ModificarProducto_ConInformacionValida() { SimpleFactContext context = new SimpleFactContext(); SimpleFactContext context2 = new SimpleFactContext(); IGenericRepository <Producto> Interface_productos = new GenericRepository <Producto>(context); IGenericRepository <Persona> Interface_persona = new GenericRepository <Persona>(context); IGenericRepository <ProductoCategoria> Interface_categoriaProducto = new GenericRepository <ProductoCategoria>(context); IGenericRepository <TipoUnidadesMedida> Interface_unidadMedida = new GenericRepository <TipoUnidadesMedida>(context); IGenericRepository <TipoImpuestos> Interface_impuestos = new GenericRepository <TipoImpuestos>(context); IGenericRepository <TipoExoneraciones> Interface_exoneraciones = new GenericRepository <TipoExoneraciones>(context); IGenericRepository <MovimientosInventario> Interface_movimientoInventario = new GenericRepository <MovimientosInventario>(context); IGenericRepository <RazonMovimientoInventario> Interface_razonesMovInventario = new GenericRepository <RazonMovimientoInventario>(context); IGenericRepository <LogErrores> Interface_logErrores = new GenericRepository <LogErrores>(context2); MantenimientoProducto manteprod = new MantenimientoProducto(Interface_productos, Interface_persona, Interface_categoriaProducto, Interface_unidadMedida, Interface_impuestos, Interface_exoneraciones, Interface_movimientoInventario, Interface_razonesMovInventario, Interface_logErrores); Producto res = manteprod.ModificarProducto(1, 1, 1, 1, 1, "Nombre Prod 3 Modificado: " + DateTime.Now.ToString(), "detalle prod 3", 2, 120, 60, "20", DateTime.Now, "1", true, 26); Assert.IsNotNull(res); }