Beispiel #1
0
 public bool Equals(ProductAdded other)
 {
     return(other != null &&
            CartId.Equals(other.CartId) &&
            ProductId.Equals(other.ProductId) &&
            Quantity.Equals(other.Quantity));
 }
Beispiel #2
0
        public Guid AddProduct(Product product, int quantity)
        {
            Guid itemId = Guid.NewGuid();

            Emit(ProductAdded.For(this, itemId, product, quantity));
            return(itemId);
        }
Beispiel #3
0
 public void When(ProductAdded productAdded)
 {
     this.cartItems.Add(
         new CartItem(
             productAdded.ItemId,
             productAdded.ProductId,
             "",
             productAdded.Quantity));
 }