public void PerRegionShippingOptionTest() { var perRegionShippingOption = new PerRegionShipping() { PerRegionCosts = new[] { new RegionShippingCost() { DestinationRegion = RegionShippingCost.Regions.UK, Amount = .75m }, new RegionShippingCost() { DestinationRegion = RegionShippingCost.Regions.Europe, Amount = 1.5m } }, }; var shippingAmount = perRegionShippingOption.GetAmount(new LineItem() { DeliveryRegion = RegionShippingCost.Regions.Europe }, new Basket()); Assert.That(shippingAmount, Is.EqualTo(1.5m)); shippingAmount = perRegionShippingOption.GetAmount(new LineItem() { DeliveryRegion = RegionShippingCost.Regions.UK }, new Basket()); Assert.That(shippingAmount, Is.EqualTo(.75m)); }
public void NewCountryShippingOptionTest() { var perCountryShippingOption = new PerRegionShipping() { PerRegionCosts = new[] { new RegionShippingCost() { DestinationRegion = RegionShippingCost.Regions.Europe, Amount = 10m } }, }; var shippingAmount = perCountryShippingOption.GetAmount(new LineItem() { DeliveryRegion = RegionShippingCost.Regions.Europe }, new Basket()); Assert.That(shippingAmount, Is.EqualTo(10.5m), "Shipping charge for Europe is wrong!"); }