Example #1
0
        public List <KeyValuePair <Vegetable, int> > GetInsufficientVegetableQuantity()
        {
            var vegetableTray = refrigerator.GetVegetableTray();
            List <KeyValuePair <Vegetable, int> > inSufficient = new List <KeyValuePair <Vegetable, int> >();

            foreach (var item in vegetableTray.GetVegetableQuantity())
            {
                var minimum = configurationManager.GetMinimumQuantity(item.Key);
                if (minimum > item.Value)
                {
                    inSufficient.Add(item);
                }
            }
            return(inSufficient);
        }
        public List <KeyValuePair <Vegetable, int> > GetInsufficientVegetableQuantity()
        {
            var insufficientVegetableQuantityList = new List <KeyValuePair <Vegetable, int> >();
            //var vegetableTray = new VegetableTray();
            var vegetablesList = refrigerator.GetVegetableQuantity();

            //var inMemoryStorage = new InMemoryStorage();
            foreach (var vegetable in vegetablesList)
            {
                var vegetableMinimumQuantity = configurationManager.GetMinimumQuantity(vegetable.Key);
                if (vegetableMinimumQuantity >= vegetable.Value)
                {
                    insufficientVegetableQuantityList.Add(vegetable);
                }
            }

            return(insufficientVegetableQuantityList);
        }