public void NegativeDeleteProductTest()
        {
            Product product = new Product(); // TODO: Initialize to an appropriate value

            int id = 56;

            string expected = "Product Id doesnot exists"; // TODO: Initialize to an appropriate value
            string actual;

            actual = LetsShopImplementation.DeleteProduct(id);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
Beispiel #2
0
        public ActionResult Delete(int id, Product product)
        {
            try
            {
                LetsShopImplementation.DeleteProduct(id);

                //cache.Add("ProductData", LetsShopImplementation.GetProducts(),
                //                   CacheItemPriority.High, null, absolutetime);

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
Beispiel #3
0
        public ActionResult Delete(int id, Product product)
        {
            try
            {
                LetsShopImplementation.DeleteProduct(id);

                cache.Add("ProductData", LetsShopImplementation.GetProducts(),
                          CacheItemPriority.High, null, absolutetime);

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, "UI Policy");
                if (rethrow)
                {
                    throw;
                }
                return(View());
            }
        }