Ejemplo n.º 1
0
 public void Total_Should_Be_0_When_1_of_2_Same_Products_Removed() {
     ShoppingCart cart = new ShoppingCart("TEST");
     Product p = new Product("SKU");
     cart.AddItem(p);
     cart.AddItem(p);
     Assert.Equal(2, cart.TotalItems);
     cart.RemoveItem(p);
     Assert.Equal(0, cart.TotalItems);
 }
Ejemplo n.º 2
0
        public void Items_Count_Should_Be_0_When_SKU_Removed() {
            ShoppingCart cart = new ShoppingCart("TEST");
            Product p = new Product("SKU");
            cart.AddItem(p, 1);
            Assert.Equal(1, cart.Items.Count);

            cart.RemoveItem("SKU");
            Assert.Equal(0, cart.Items.Count);

        }