Пример #1
0
        public void TotalPrice2DifferentItems()
        {
            var checkout = new Checkout();

            var item = new Item();
            item.SKU = "A";
            item.Price = 50;

            checkout.AddItem( item );

            item = new Item();
            item.SKU = "B";
            item.Price = 30;
            item.Offer = new Offer() { Price = 80, Quantity = 3 };

            checkout.AddItem( item );

            Assert.AreEqual( 80, checkout.TotalPrice() );
        }
Пример #2
0
        public void TotalPriceWith1Multiple()
        {
            var checkout = new Checkout();

            var item = new Item();
            item.SKU = "A";
            item.Price = 50;

            checkout.AddItem( item );

            item = new Item();
            item.SKU = "B";
            item.Price = 30;
            item.Offer = new Offer() { Price = 80, Quantity = 3 };

            checkout.AddItem( item );

            for ( int i = 0; i < 2; i++ )
            {
                item = new Item();
                item.SKU = "B";
                item.Price = 30;

                checkout.AddItem( item );
            }

            Assert.AreEqual( 130, checkout.TotalPrice() );
        }