示例#1
0
        public string[] GetValidUserInput()
        {
            string[] answer;

            while (true)
            {
                var userInput      = _inputReceiver.ReceiveUserInput();
                var processedInput = _inputProcessor.ProcessInput(userInput);
                var inputIsValid   = _inputValidator.InputIsValid(processedInput);

                if (!inputIsValid)
                {
                    Console.WriteLine(_inputValidator.ErrorMessage);
                    continue;
                }
                answer = processedInput;
                break;
            }
            return(answer);
        }