Пример #1
0
        public Latte(int price, ProductGroup.ProductsGroups productsClassifications, List <Supplement> supplements = null) : base(price, productsClassifications, supplements)
        {
            Name = "Латте";

            Supplements.Add(new Milk(10)
            {
                IsNotRequrement = false
            });
        }
Пример #2
0
        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
            });
        }
Пример #3
0
        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);
        }