public void Add_Item() { var cart = m_CartService.CreateAndSaveCart("vis1"); var price = new Model.Price(10.0, 0.196); m_CartService.AddItem(cart, "test1", 1, 1, 2, price); Assert.AreEqual(cart.ItemCount, 1); Assert.AreEqual(cart.Total, 10 * 2); Assert.AreEqual(cart.TotalTax, 10 * 2 * 0.196m); Assert.AreEqual(cart.TotalWithTax, 10 * 2 * 1.196m); }
public void Add_Item_With_Recycle_Price() { var cart = m_CartService.CreateAndSaveCart("vis1"); var price = new Model.Price(10.0, 0.196); var recycle = new Model.Price(0.1, 0.196); m_CartService.AddItem(cart, "test1", 1, 1, 2, price, recycle); Assert.AreEqual(cart.ItemCount, 1); Assert.AreEqual(cart.Total, 10 * 2); Assert.AreEqual(cart.TotalTax, 10 * 2 * 0.196m); Assert.AreEqual(cart.TotalWithTax, 10 * 2 * 1.196m); Assert.AreEqual(cart.RecycleTotal, 0.1 * 2); Assert.AreEqual(cart.RecycleTaxTotal, 0.1m * 2 * 0.196m); Assert.AreEqual(cart.RecycleTotalWithTax, 0.1m * 2 * 1.196m); Assert.AreEqual(cart.GrandTotal, (10 + 0.1) * 2); Assert.AreEqual(cart.GrandTaxTotal, (10 + 0.1m) * 2 * 0.196m); Assert.AreEqual(cart.GrandTotalWithTax, (10 + 0.1m) * 2 * 1.196m); }
public void Clear_Cart() { var cart = m_CartService.CreateAndSaveCart("vis1"); var price1 = new Model.Price(10.0, 0.196); m_CartService.AddItem(cart, "test1", 1, 1, 2, price1); var price2 = new Model.Price(20.0, 0.196); m_CartService.AddItem(cart, "test2", 1, 1, 3, price2); Assert.AreEqual(cart.ItemCount, 2); m_CartService.Clear(cart); Assert.AreEqual(cart.ItemCount, 0); }