public void CartIsInitiallyEmpty() { var services = CartServiceContext.GivenServices(); var cart = services.WhenLoadCart(); cart.CartItems.Count().Should().Be(0); }
public void DoNotApplyDiscountToNonLoyaltyCardHolders() { var services = CartServiceContext.GivenServices(); var cart = services.WhenLoadCart(); services.WhenAddItemToCart(cart); cart.CartItems.Should().ContainSingle() .Which.ItemTotal.Should().Be(18.80m); }
public void CanAddItemToCart() { var services = CartServiceContext.GivenServices(); var cart = services.WhenLoadCart(); services.WhenAddItemToCart(cart); cart.CartItems.Count().Should().Be(1); }
public void CanLoadCartWithOneItem() { var services = CartServiceContext.GivenServices(); InitializeCartWithOneItem(services.EmailAddress); var cart = services.WhenLoadCart(); cart.CartItems.Count().Should().Be(1); cart.CartItems.Single().Quantity.Should().Be(2); }
public void ApplyDiscountToLoyaltyCardHolders() { var services = CartServiceContext.GivenServices(); InitializeUserWithLoyaltyCard(services.EmailAddress); var cart = services.WhenLoadCart(); services.WhenAddItemToCart(cart); cart.CartItems.Should().ContainSingle() .Which.ItemTotal.Should().Be(0.9m * 18.80m); }
public void GroupItemsOfSameKind() { var services = CartServiceContext.GivenServices(); var cart = services.WhenLoadCart(); services.WhenAddItemToCart(cart, quantity: 2); services.WhenAddItemToCart(cart, quantity: 1); cart.CartItems.Count().Should().Be(1); cart.CartItems.Single().Quantity.Should().Be(3); }