public void DeleteProductCtrFail() { var productCtr = new ProductCtr(new ProductCtrTestClass()); var flag = productCtr.DeleteProduct(0); Assert.AreEqual(0, flag); }
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); }
/// <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)); }