Esempio n. 1
0
 public void Cart_Item_Quantity_Should_Adjust_To_10()
 {
     ShoppingCart cart = new ShoppingCart("TEST");
     Product p = new Product("SKU");
     cart.AddItem(p);
     cart.AdjustQuantity(p, 10);
     Assert.AreEqual(10, cart.TotalItems);
 }
Esempio n. 2
0
        public void ItemLastAdded_Should_Be_Sku2_When_SKu1_Sku2_Added_In_Sequence_Regardless_Of_Adjustments()
        {
            ShoppingCart cart = new ShoppingCart("TEST");
            Product p = new Product("SKU1");
            Product p2 = new Product("SKU2");
            cart.AddItem(p, 1, DateTime.Now.AddSeconds(-1));
            cart.AddItem(p2, 1, DateTime.Now.AddSeconds(1));

            cart.AdjustQuantity(p, 10);

            Assert.AreEqual("SKU2", cart.ItemLastAdded.Product.SKU);
        }
Esempio n. 3
0
 public void Items_Count_Should_Be_0_When_10_Items_Adjusted_To_Negative_10()
 {
     ShoppingCart cart = new ShoppingCart("TEST");
     Product p = new Product("SKU");
     cart.AddItem(p, 10);
     cart.AdjustQuantity(p, -10);
     Assert.AreEqual(0, cart.Items.Count);
 }