예제 #1
0
        public void Calculate_tests()
        {
            INumberOfProduct numberOfProduct = Resolve <INumberOfProduct>();

            var cart = new Cart
            {
                ProductTransactions = new List <ProductTransaction>
                {
                    new ProductTransaction(),
                    new ProductTransaction(),
                    new ProductTransaction(),
                },
            };

            var productCount = numberOfProduct.Calculate(cart);

            Assert.Equal(3, productCount);
        }
예제 #2
0
 public decimal Calculate(Cart shoppingCard)
 {
     return(_numberOfProduct.Calculate(shoppingCard) + _numberOfDelivery.Calculate(shoppingCard) + MinDeliveryCost);
 }