public Latte(int price, ProductGroup.ProductsGroups productsClassifications, List <Supplement> supplements = null) : base(price, productsClassifications, supplements) { Name = "Латте"; Supplements.Add(new Milk(10) { IsNotRequrement = false }); }
public Cappuccino(int price, ProductGroup.ProductsGroups productsClassifications, List <Supplement> supplements = null) : base(price, productsClassifications, supplements) { Name = "Капучино"; Supplements.Add(new Milk(10) { IsNotRequrement = false }); Supplements.Add(new MilkyFoam(15) { IsNotRequrement = false }); }
private Result(Result result, string supplementName, IDictionary <string, string> supplement) { Status = result.Status; Exception = result.Exception; foreach (var pair in result.Supplements) { Supplements.Add(pair); } if (HasSupplement(supplementName)) { throw new ArgumentException($"Result already has supplement named: {supplementName}", nameof(supplementName)); } Supplements.Add(supplementName, supplement); }