public void ShouldBeTheTotalIfThereAreNoGiftCardsApplied() { var testableCartModel = new TestableCartModel(total: 100m) { AppliedGiftCards = new List<GiftCard>() }; testableCartModel.TotalToPay.Should().Be(100m); }
public void IfShippingIsRequiredAndMethodNotSetAndSomePotentialMethodsShouldBeShippingNotSet() { var cartModel = new TestableCartModel(requiresShipping: true) { ShippingMethod = null, PotentiallyAvailableShippingMethods = new HashSet<IShippingMethod> { A.Fake<IShippingMethod>()} }; cartModel.ShippingStatus.Should().Be(CartShippingStatus.ShippingNotSet); }
public void ShouldBeTheSumOfTheItemsPriceLessTheOrderTotalDiscount() { var model = new TestableCartModel(orderTotalDiscount: 10m) { Items = new List<CartItem> { new CartItemBuilder().WithPricePreTax(10).WithTax(5).Build(), new CartItemBuilder().WithPricePreTax(20).WithTax(5).Build(), new CartItemBuilder().WithPricePreTax(30).WithTax(5).Build() } }; model.TotalPreShipping.Should().Be(65); }
public void ShouldBeTheTotalIfTheSumOfTheAvailableAmountIsGreaterThanTheTotal() { var testableCartModel = new TestableCartModel(total: 50m) { AppliedGiftCards = new List<GiftCard> { new GiftCardBuilder().WithAvailableAmount(10m).Build(), new GiftCardBuilder().WithAvailableAmount(20m).Build(), new GiftCardBuilder().WithAvailableAmount(30m).Build() } }; testableCartModel.GiftCardAmount.Should().Be(50m); }
public void ShouldBeTheSumOfTheAvailableAmountOfTheGiftCardsApplied() { var testableCartModel = new TestableCartModel(total: 100m) { AppliedGiftCards = new List<GiftCard> { new GiftCardBuilder().WithAvailableAmount(10m).Build(), new GiftCardBuilder().WithAvailableAmount(20m).Build(), new GiftCardBuilder().WithAvailableAmount(30m).Build() } }; testableCartModel.GiftCardAmount.Should().Be(60m); }
public void IfShippingIsRequiredAndIsSetShouldBeShippingSet() { var cartModel = new TestableCartModel(requiresShipping: true){ShippingMethod = A.Fake<IShippingMethod>()}; cartModel.ShippingStatus.Should().Be(CartShippingStatus.ShippingSet); }
public void IfShippingIsNotRequiredStatusShouldBeNotRequired() { var cartModel = new TestableCartModel(requiresShipping: false); cartModel.ShippingStatus.Should().Be(CartShippingStatus.ShippingNotRequired); }
public void ShouldBeOrderTotalDiscountPlusItemTotalIfThatAmountIsLessThanTHeOrderTotalPreDiscount() { var cartModel = new TestableCartModel(totalPreDiscount: 20m, orderTotalDiscount: 10m, itemDiscount: 5m); cartModel.DiscountAmount.Should().Be(15m); }
public void ShouldBeShippingTotalLessTax() { var cartModel = new TestableCartModel(shippingTotal: 10m, shippingTax: 1m); cartModel.ShippingPreTax.Should().Be(9m); }
public void ShouldBeTheItemTaxPlusTheShippingTax() { var model = new TestableCartModel(itemTax: 10m, shippingTax: 5m); model.Tax.Should().Be(15); }
public void PayPalShippingServiceTests_GetNoShipping_ShouldBe0WhenRequiresShippingAndAddressIsSet() { var testableCartModel = new TestableCartModel(requiresShipping: true) {ShippingAddress = new Address()}; _payPalShippingService.GetNoShipping(testableCartModel).Should().Be("0"); }
public void ShouldBeTheTotalPreShippingPlusTheShippingTotal() { var model = new TestableCartModel(totalPreShipping: 10m, shippingTotal: 5m); model.Total.Should().Be(15); }
public void ShouldBeTheTotalLessTheAppliedGiftCardAvailableAmount() { var testableCartModel = new TestableCartModel(total: 100m, giftCardAmount:60m); testableCartModel.TotalToPay.Should().Be(40m); }