예제 #1
0
        public void SinglePairedBuy()
        {
            var basket = new List <BasketItem>()
            {
                new BasketItem("C", 1, 20M),
                new BasketItem("D", 1, 15M)
            };

            var promotions = new List <Promotion>()
            {
                new Promotion("C + D for 30", Promotions.MakePairedBuy("C", "D", 30M))
            };
            var result = Promotions.TotalAfterPromotions(basket, promotions);

            result.Should().Be(30);
        }