public void Buy_SingleBook_CatalogPrice() { double price = _store.Buy( "Robin Hobb - Assassin Apprentice"); Assert.AreEqual(12, price); }
public void When_client_buy_on_book_he_pays_at_the_price() { // ARRANGE double expectedPrice = 24.0; // ACT double price = store.Buy("J.K Rowling - Goblet Of fire", "Isaac Asimov - Foundation"); // ASSERT Assert.AreEqual(expectedPrice, price); }
public void Update(IStore sender, CustomerNotificationArgs args) { if (args.Item.Type == Interest) { if (args.Item.Price <= Budget) { Budget -= args.Item.Price; sender.Buy(this, args.Item); } } }
public IActionResult GetPrice([FromBody] BooksVM bookNames) { try { double price = _librairieService.Buy(bookNames.BookNames); return(Ok(price)); } catch (NotEnoughInventoryException ex) { return(BadRequest(ex.Missing.ToList())); } }
public ActionResult Buy([FromBody] params string[] basketNames) { try { double basketPrice = _storeService.Buy(basketNames); return(Ok(basketPrice)); } catch (NotEnoughInventoryException nex) { return(BadRequest(new { Exception = nex.Message, Books = nex.Missing })); } }
public double BooksPrice(string[] booksNames) { return(_storeRepo.Buy(booksNames)); }