public void Success_Normal_NoCheckCartItems(IEnumerable <ProductInCart> productsAdd) { foreach (ProductInCart product in productsAdd) { Assert.IsTrue(MarketBridge.AddProductToUserCart(product)); } Products?.AddRange(productsAdd); }
public void Failure_ProductDoesntExist() { ProductForCart product = ProductsAdd.First(); Assert.IsFalse(MarketBridge.AddProductToUserCart(new ProductInCart(new ProductId(Guid.NewGuid()), product.CartQuantity))); new Assert_SetEquals <ProductId, ProductInCart> ( Enumerable.Empty <ProductInCart>(), x => x.ProductId ).AssertEquals(MarketBridge.GetShoppingCartItems()); }
public void Failure_ProductAlreadyInCart() { Success_NoBasket(); ProductForCart product = ProductsAdd.First(); Assert.IsFalse(MarketBridge.AddProductToUserCart(new ProductInCart(product.ProductIdentifiable.ProductId, product.CartQuantity + 1))); new Assert_SetEquals <ProductId, ProductInCart> ( new ProductInCart[] { new ProductInCart(product.ProductIdentifiable.ProductId, product.CartQuantity) }, x => x.ProductId ).AssertEquals(MarketBridge.GetShoppingCartItems()); }