示例#1
0
        public void GivenBookStore_WhenBuy_ThenOnlyFirtCopyOfCategoryHasDiscount()
        {
            var bookStore = new BookStore();

            bookStore.Import(json);
            Assert.AreEqual(30, bookStore.Buy("J.K Rowling - Goblet Of fire", "Robin Hobb - Assassin Apprentice", "Robin Hobb - Assassin Apprentice"));

            Assert.AreEqual(69.95, bookStore.Buy("Ayn Rand - FountainHead", "Isaac Asimov - Foundation", "Isaac Asimov - Robot series", "J.K Rowling - Goblet Of fire", "J.K Rowling - Goblet Of fire", "Robin Hobb - Assassin Apprentice", "Robin Hobb - Assassin Apprentice"));
        }
示例#2
0
        public void GivenBookStore_WhenBuyOneBook_ThenPriceShouldBeThePriceInTheCatalog()
        {
            var bookStore = new BookStore();

            bookStore.Import(json);
            Assert.AreEqual(8, bookStore.Buy("J.K Rowling - Goblet Of fire"));
        }
示例#3
0
        public void GivenBookStore_WhenInvalidbasket_ThenShouldThrowException()
        {
            var bookStore = new BookStore();

            bookStore.Import(json);
            Assert.AreEqual(0, bookStore.Buy("Isaac Asimov - Foundation", "Isaac Asimov - Foundation"));
        }
示例#4
0
        public void GivenBookStore_WhenBuyManyBookOfSameCategory_ThenApplyDiscount()
        {
            var bookStore = new BookStore();

            bookStore.Import(json);
            Assert.AreEqual(18, bookStore.Buy("J.K Rowling - Goblet Of fire", "Robin Hobb - Assassin Apprentice"));
        }