Esempio n. 1
0
        public void ApplyBaseTaxForProductTest()
        {
            IProduct p = new Product("testproduct", 12.49, 1, false);

            p = mng.ApplyTax(p);

            Assert.AreEqual(1.25, p.Tax);
        }
Esempio n. 2
0
        /// <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);
            }
        }
Esempio n. 3
0
        /// <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));
        }