public void DoesCartHaveGreaterThanOrEqualItems_itemInCart_quantityIsNotGreater_returnsFalse() {
     ShoppingCart cart = new ShoppingCart();
     Item item = new Item("Apple");
     cart.AddItem(item, 1);
     Assert.IsFalse(cart.DoesCartHaveGreaterThanOrEqualItems(item, 3));
 }
 public void DoesCartHaveGreaterThanOrEqualItems_itemNotInCart_returnsFalse() {
     ShoppingCart cart = new ShoppingCart();
     Assert.IsFalse(cart.DoesCartHaveGreaterThanOrEqualItems(new Item("Apple"), 1));
 }
 public void DoesCartHaveGreaterThanOrEqualItems_nullItem_expectException() {
     ShoppingCart cart = new ShoppingCart();
     cart.DoesCartHaveGreaterThanOrEqualItems(null, 1);
 }
 public void DoesCartHaveGreaterThanOrEqualItems_negativeQuantity_expectException() {
     ShoppingCart cart = new ShoppingCart();
     cart.DoesCartHaveGreaterThanOrEqualItems(new Item("Apple"), -1);
 }
Example #5
0
 public bool DoesPromotionApply(ShoppingCart cart) {
     if (cart == null) {
         throw new ArgumentException(ERROR_MSG_NULL_SHOPPING_CART);
     }
     return cart.DoesCartHaveGreaterThanOrEqualItems(item, MinimumNumberItemsForPromotion);
 }