예제 #1
0
        public IHttpActionResult PostUpdateProduct(Product product)
        {
            IProducManager mprod    = new IProducManager();
            var            response = mprod.PostProductUpdate(product);

            return(Ok(response));
        }
예제 #2
0
        public IHttpActionResult GetProductId(long Id)
        {
            IProducManager mprod    = new IProducManager();
            var            products = mprod.GetProductId(Id);

            return(Ok(products));
        }
예제 #3
0
        public IHttpActionResult DeleteProduct(long Id)
        {
            IProducManager mprod    = new IProducManager();
            var            response = mprod.DeleteProduct(Id);

            return(Ok(response));
        }
예제 #4
0
        public void PaginacionTest()
        {
            IProducManager mprod   = new IProducManager();
            var            paginas = mprod.Pagination();

            Assert.AreEqual(paginas, 4);
        }
예제 #5
0
        public void ProductIdTest()
        {
            int            IdProduct = 2;
            IProducManager mprod     = new IProducManager();
            var            product   = mprod.GetProductId(IdProduct);

            Assert.AreEqual(product.name, "semifinal copa libertadores");
        }
예제 #6
0
        public IHttpActionResult GetAll(int page)
        {
            IProducManager mprod      = new IProducManager();
            DALProduct     dalProduct = new DALProduct();

            var responseProducs = new ResponseProduct();

            responseProducs.totalPaginas = mprod.Pagination();

            responseProducs.products = dalProduct.GetProducts(page);

            return(Ok(responseProducs));
        }