Ejemplo n.º 1
0
        public void IfProductDoesHaveRestrictedShippingAndThereAreNoShippingTypesAvailableShouldNotShip()
        {
            var productVariant = new ProductVariantBuilder().WithRestrictedShipping().Build();
            var productShippingChecker = new ProductShippingCheckerBuilder().Build();

            productShippingChecker.CanShip(productVariant).Should().BeFalse();
        }
Ejemplo n.º 2
0
        public void IfProductDoesNotHaveRestrictedShippingItCanShip()
        {
            var productVariant = new ProductVariantBuilder().WithUnrestrictedShipping().Build();
            var productShippingChecker = new ProductShippingCheckerBuilder().Build();

            productShippingChecker.CanShip(productVariant).Should().BeTrue();
        }
Ejemplo n.º 3
0
        public void IfRestrictedShippingAndCartModelAndProductVariantHaveMatchingShippingMethodsCanShip()
        {
            var method = new StubShippingMethod1();
            var productVariant = new ProductVariantBuilder().WithRestrictedShipping(method.TypeName).Build();
            var cartModel = new CartModelBuilder().WithShippingOptions(method).Build();
            var productShippingChecker = new ProductShippingCheckerBuilder().WithCartModel(cartModel).Build();

            productShippingChecker.CanShip(productVariant).Should().BeTrue();
        }
Ejemplo n.º 4
0
        public void IfRestrictedShippingAndCartModelAndProductVariantHaveNoSharedShippingMethodsCannotShip()
        {
            var method1 = new StubShippingMethod1();
            var method2 = new StubShippingMethod2();
            var productVariant = new ProductVariantBuilder().WithRestrictedShipping(method1.TypeName).Build();
            var cartModel = new CartModelBuilder().WithShippingOptions(method2).Build();
            var productShippingChecker = new ProductShippingCheckerBuilder().WithCartModel(cartModel).Build();

            productShippingChecker.CanShip(productVariant).Should().BeFalse();
        }