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")); }
public void GivenBookStore_WhenBuyOneBook_ThenPriceShouldBeThePriceInTheCatalog() { var bookStore = new BookStore(); bookStore.Import(json); Assert.AreEqual(8, bookStore.Buy("J.K Rowling - Goblet Of fire")); }
public void GivenBookStore_WhenInvalidbasket_ThenShouldThrowException() { var bookStore = new BookStore(); bookStore.Import(json); Assert.AreEqual(0, bookStore.Buy("Isaac Asimov - Foundation", "Isaac Asimov - Foundation")); }
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")); }