public void GivesRightPriceForTwoDifferentBooks()
        {
            var books = new[] { HPLibrary.GetBookById(1), HPLibrary.GetBookById(2) };

            var price = new PriceCalculator().Calculate(books.ToList());

            Assert.That(price, Is.EqualTo(15.2m));
        }
        public void OneBookCostsEightEuro()
        {
            var books = new[]
            {
                HPLibrary.GetBookById(1),
            };

            var price = new PriceCalculator().Calculate(books.ToList());

            Assert.That(price, Is.EqualTo(8));
        }
        public void GivesRightPriceForTwoCopiesOfFirstBookAndOneOfTheSecond()
        {
            var books = new[]
            {
                HPLibrary.GetBookById(1), HPLibrary.GetBookById(1),
                HPLibrary.GetBookById(2)
            };

            var price = new PriceCalculator().Calculate(books.ToList());

            Assert.That(price, Is.EqualTo(23.2m));
        }
        public void GivesTheRightPriceForMultipleSets()
        {
            var books = new[]
            {
                HPLibrary.GetBookById(1),
                HPLibrary.GetBookById(1),
                HPLibrary.GetBookById(2),
                HPLibrary.GetBookById(2),
                HPLibrary.GetBookById(3),
                HPLibrary.GetBookById(3),
                HPLibrary.GetBookById(4),
                HPLibrary.GetBookById(5)
            };

            var price = new PriceCalculator().Calculate(books.ToList());

            Assert.That(price, Is.EqualTo(51.6));
        }
        public void EveryIndividualBookCostsEightEuro()
        {
            var books = HPLibrary.GetAllBooks().ToList();

            Assert.That(books.Select(book => book.Price), Is.All.EqualTo(8m));
        }