Example #1
0
        public void Buy_One_HarryPotter1_One_HarryPotter2_One_HarryPotter3_One_HarryPotter4_One_HarryPotter5_Price_Should_Match()
        {
            var target = new ShoppingCar();

            target.Buy(new Book("HarryPotter1", 1));
            target.Buy(new Book("HarryPotter2", 1));
            target.Buy(new Book("HarryPotter3", 1));
            target.Buy(new Book("HarryPotter4", 1));
            target.Buy(new Book("HarryPotter5", 1));

            var expected = 375m;

            Assert.AreEqual(expected, target.GetPrice());
        }
Example #2
0
        public void Buy_Nothing_Price_Should_Match()
        {
            var target = new ShoppingCar();

            target.Buy(new Book("HarryPotter1", 0));
            target.Buy(new Book("HarryPotter2", 0));
            target.Buy(new Book("HarryPotter3", 0));
            target.Buy(new Book("HarryPotter4", 0));
            target.Buy(new Book("HarryPotter5", 0));

            var expected = 0;

            Assert.AreEqual(expected, target.GetPrice());
        }