public void ApplyBaseTaxForProductTest() { IProduct p = new Product("testproduct", 12.49, 1, false); p = mng.ApplyTax(p); Assert.AreEqual(1.25, p.Tax); }
/// <summary> /// Function apply taxes or each product in shopping cart /// </summary> /// <param name="pCart">Shopping cart to be processed</param> public void ProcessCart(ShoppingCart pCart) { productList = pCart.GetProductsList(); foreach (IProduct p in productList) { taxMng.ApplyTax(p); } }
/// <summary> /// Function apply taxes or each product in shopping cart /// </summary> /// <param name="pCart">Shopping cart to be processed</param> //public void ProcessCart(ShoppingCart pCart) //{ // productList = pCart.GetProductsList(); // foreach (IProduct p in productList) // { // taxMng.ApplyTax(p); // } //} public Receipt ProcessCart(ShoppingCart pCart) { productList = pCart.GetProductsList(); foreach (IProduct p in productList) { taxMng.ApplyTax(p); } return(new Receipt(productList)); }