예제 #1
0
        public void should_total_full_product_price_for_any_products_over_the_special_offer_threshold()
        {
            var specialOffer = new SpecialOffer("A", new Criteria(3, 130));
            var products     = new List <Product>
            {
                new Product('A', 50),
                new Product('A', 50),
                new Product('A', 50),
                new Product('A', 50),
            }.GroupBy(p => p.Name).First();

            var discountedTotal = specialOffer.ApplyDiscountTo(products);

            Assert.That(180, Is.EqualTo(discountedTotal));
        }