Ejemplo n.º 1
0
        public void AskCustomer()
        {
            // size
            var largeInput = io.ShowPrompt(SIZE_MESSAGE, PROMPT_MESSAGE);
            var isLarge    = false;

            if (HasValidBoolean(largeInput, out isLarge))
            {
                coffee.IsLarge = isLarge;
            }

            // milk
            var milkInput = io.ShowPrompt(MILK_MESSAGE, PROMPT_MESSAGE);
            var hasMilk   = false;

            if (HasValidBoolean(milkInput, out hasMilk))
            {
                coffee.HasMilk = hasMilk;
            }

            // sugar
            var sugarInput    = io.ShowPrompt(SUGAR_MESSAGE, SUGAR_RANGE_MESSAGE);
            var numberOfSugar = 0;

            if (HasValidSugar(sugarInput, out numberOfSugar))
            {
                coffee.NumberOfSugar = numberOfSugar;
            }

            // foam
            var foamInput    = io.ShowPrompt(FOAM_MESSAGE, PROMPT_MESSAGE);
            var milkIsFoamed = false;

            if (HasValidBoolean(foamInput, out milkIsFoamed))
            {
                coffee.MilkIsFoamed = milkIsFoamed;
            }

            // sprinkle
            var chocolateInput = io.ShowPrompt(SPRINKLE_MESSAGE, PROMPT_MESSAGE);
            var hasSprinkles   = false;

            if (HasValidBoolean(chocolateInput, out hasSprinkles))
            {
                coffee.HasSprinkles = hasSprinkles;
            }
        }