Exemple #1
0
        public void TestGrabarVentaError()
        {
            //Definiendo Datos ingreso
            VS.PedidoEntidad oPedidoEntidad = new VS.PedidoEntidad();
            oPedidoEntidad.Dir_Entrega   = "Av. El Sol 456";
            oPedidoEntidad.Fecha_Entrega = DateTime.Parse("13/07/2018");
            oPedidoEntidad.Cliente       = new VS.ClienteEntidad
            {
                Nom_Cliente = "Williams Morales",
                Ema_Cliente = "*****@*****.**"
            };
            oPedidoEntidad.MedioPago = new VS.MedioPagoEntidad
            {
                Cod_MedioPago = 1
            };
            //Comunicarse con el Servicio
            VS.VentaServiceClient proxy = new VS.VentaServiceClient();
            oPedidoEntidad.DetallePedido = proxy.BuscarDetallePedido();
            oPedidoEntidad.Total_Neto    = oPedidoEntidad.DetallePedido.Sum(x => x.SubTotal);
            var respuesta = proxy.GrabarVenta(oPedidoEntidad);


            //Validar Respuesta
            Assert.AreEqual(true, respuesta.Estado);
        }
Exemple #2
0
        public void TestGrabarVenta()
        {
            VS.VentaServiceClient proxy = new VS.VentaServiceClient();

            //Consultar Categorias de Productos
            var ListaCategorias = proxy.ListarCategoria();

            //Consultar Productos por Categoria

            var ListaProductos = proxy.BuscarProducto(new VS.ProductoEntidad
            {
                Categoria = new VS.CategoriaEntidad
                {
                    Cod_Categoria = ListaCategorias[0].Cod_Categoria,
                }
            });

            //Definiendo Datos ingreso
            var oProductoEntidad = ListaProductos[1];

            oProductoEntidad.Cantidad = 2;

            //Comunicarse con el Servicio
            proxy.ReservarProducto(oProductoEntidad);

            //Definiendo Datos ingreso Compra
            VS.PedidoEntidad oPedidoEntidad = new VS.PedidoEntidad();
            oPedidoEntidad.Dir_Entrega   = "Av. El Sol 456";
            oPedidoEntidad.Fecha_Entrega = DateTime.Parse("13/07/2018");
            oPedidoEntidad.Cliente       = new VS.ClienteEntidad
            {
                Nom_Cliente = "Williams Morales",
                Ema_Cliente = "*****@*****.**"
            };
            oPedidoEntidad.MedioPago = new VS.MedioPagoEntidad
            {
                Cod_MedioPago = 1
            };
            //Comunicarse con el Servicio

            oPedidoEntidad.DetallePedido = proxy.BuscarDetallePedido();
            oPedidoEntidad.Total_Neto    = oPedidoEntidad.DetallePedido.Sum(x => x.SubTotal);
            var respuesta = proxy.GrabarVenta(oPedidoEntidad);


            //Validar Respuesta
            Assert.AreEqual(true, respuesta.Estado);
        }