public bool Equals(ProductAdded other) { return(other != null && CartId.Equals(other.CartId) && ProductId.Equals(other.ProductId) && Quantity.Equals(other.Quantity)); }
public Guid AddProduct(Product product, int quantity) { Guid itemId = Guid.NewGuid(); Emit(ProductAdded.For(this, itemId, product, quantity)); return(itemId); }
public void When(ProductAdded productAdded) { this.cartItems.Add( new CartItem( productAdded.ItemId, productAdded.ProductId, "", productAdded.Quantity)); }