private static void PopulateBasket(IBasket basket) { Item item1 = new SportItem(15, "Football", 1, SportItemKind.X); basket.Add(item1); Item item2 = new SportItem(10, "Baseball", 1, SportItemKind.Y); basket.Add(item2); }
public void AddItem_GivenItemA_BaksetCountShouldBe1() { //Arrange var expected = 1; var item = new BasketItem("A"); //Act basket.Add(item); //Assert var total = basket.Total; Assert.That(total, Is.EqualTo(expected)); }
public void GivenIHaveAddedNInstancesOfAnItemToTheBasket(int number, string item) { for (var i = 0; i < number; i++) { _basket.Add(item); } }
public void AddProductToBasketAndShowBasketPage() { Product product = _productService.GetProductBy(_view.ProductId); _basket.Add(product); _pageNavigator.NaviagteTo(PageDirectory.Basket); }
public IActionResult Create(Basket basket) { if (ModelState.IsValid) { _context.Add(basket); return(RedirectToAction("Index")); } return(View(basket)); }
public HttpResponseMessage Add(string username, ShoppingCartItem item) { try { item.Customer = username; _basket.Add(item); return(new HttpResponseMessage(HttpStatusCode.OK)); } catch (Exception e) { return(new HttpResponseMessage(HttpStatusCode.BadRequest)); } }
public void AddItemTest() { _basket.Add(_products[0], 100); Assert.Equal(1, _basket.Items.Count()); }