예제 #1
0
        public void should_calculate_discounted_price_of_a_single_item_when_offer_can_be_applied()
        {
            var data = new List <Product>
            {
                new Product('A', 50m, new PercentageOffer(0.9m))
            };

            var pricingRepository = new InMemoryRepository(data);
            var checkout          = new Checkout(pricingRepository);
            var discountedPrice   = checkout.CalculatePriceFor("A");

            Assert.Equal(45m, discountedPrice);
        }