Exemple #1
0
 public static void EnterNumberOfSugars(Drink drink, bool isValid)
 {
     _displayText.DisplayDrinkSugarCountText(isValid);
     string input = Console.ReadLine();
     if (_hanldeUserInput.HandleUserSugarOption(input))
     {
         drink.SetSugars(Int32.Parse(input));
     }
     else
     {
         EnterNumberOfSugars(drink, false);
     }
 }
Exemple #2
0
 public static void EnterDrinkOption(Drink drink,bool isValid)
 {
     _displayText.DisplayDrinkOptionText(isValid); // Determines what text to display to the user
     var input = Console.ReadLine();
     if (_hanldeUserInput.HandleUserDrinkOptionInput(input))
     {
         drink.SetDrinkType((DrinkType)Enum.Parse(typeof(DrinkType), input));
     }
     else
     {
         EnterDrinkOption(drink, false);
     }
 }
Exemple #3
0
 public static void EnterMilkOption(Drink drink, bool isValid)
 {
     _displayText.DisplayMilkChoice(isValid);
     string input = Console.ReadLine();
     if (_hanldeUserInput.HandleUserMilkOption(input))
     {
         MilkOptions milkOptions = new MilkOptions();
         drink.SetMilk(milkOptions.GetValue(input));
     }
     else
     {
         EnterMilkOption(drink, false);
     }
 }