Ejemplo n.º 1
0
        public void DeleteProductCtrFail()
        {
            var productCtr = new ProductCtr(new ProductCtrTestClass());
            var flag       = productCtr.DeleteProduct(0);

            Assert.AreEqual(0, flag);
        }
Ejemplo n.º 2
0
        public void DeleteProductCtr()
        {
            var productCtr = new ProductCtr(new ProductCtrTestClass());
            var product    = new Product("The product1 name", 23.45m, "The product1 description", "The product1 catagory", "Img path");
            var flag       = productCtr.AddProduct(product);

            flag = productCtr.DeleteProduct(flag);
            Assert.AreEqual(1, flag);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Delete a Product
 /// </summary>
 /// <param name="id"></param>
 /// <returns>
 /// Return 1 if Product was deleted, else 0
 /// </returns>
 public int DeleteProduct(int id)
 {
     return(ProductCtr.DeleteProduct(id));
 }