Beispiel #1
0
        public void FinalizeOrderWithoutPurchaseProvider_ThrowsException()
        {
            var orderFactory = new StandardOrderFactory();

            var order = orderFactory.GetOrder();

            var cart = new ShoppingCart(order, null);

            cart.Finalize();
        }
Beispiel #2
0
        private ShoppingCart CreateShoppingCart(IPurchaseProviderFactory purchaseProviderFactory = null)
        {
            var orderFactory = new StandardOrderFactory();

            var order = orderFactory.GetOrder();

            var provider = purchaseProviderFactory ?? new SwedenPurchaseProviderFactory();

            var cart = new ShoppingCart(order, provider);

            return(cart);
        }
Beispiel #3
0
        public void FinalizeOrderWithSwedenPurchaseProvider_GeneratesShippingLabel()
        {
            var orderFactory = new StandardOrderFactory();

            var order = orderFactory.GetOrder();

            var purchaseProviderFactory = new SwedenPurchaseProviderFactory();

            var cart = new ShoppingCart(order, purchaseProviderFactory);

            var label = cart.Finalize();

            Assert.IsNotNull(label);
        }