public PricedProductItem Substract(PricedProductItem pricedProductItem) { if (!MatchesProductAndPrice(pricedProductItem)) { throw new ArgumentException("Product or price does not match."); } return(new PricedProductItem(ProductItem.Substract(pricedProductItem.ProductItem), UnitPrice)); }
public bool HasTheSameQuantity(PricedProductItem pricedProductItem) { return(ProductItem.HasTheSameQuantity(pricedProductItem.ProductItem)); }
public bool MatchesProductAndPrice(PricedProductItem pricedProductItem) { return(ProductId == pricedProductItem.ProductId && UnitPrice == pricedProductItem.UnitPrice); }