Example #1
0
        /// <summary>
        /// Executes the helper question test.
        /// </summary>
        /// <param name="question">The question.</param>
        /// <param name="options">The option with <see cref="AbstractTester"/>.</param>
        /// <returns>The user answer.</returns>
        public Mixture Ask(BaseQuestion question, params Mixture[] options)
        {
            var input = new InputArgs();

            if (options.TryGet("interactive", out Mixture exists))
            {
                input.SetInteractive(exists);
            }

            if (inputs != null && inputs.Length > 0)
            {
                input.SetInputStream(CreateStream(inputs));
            }

            Initialize(options);
            return(Helper.Ask(input, Output, question));
        }
Example #2
0
        /// <summary>
        /// Track specified intput/output.
        /// </summary>
        /// <param name="io">The specified intput/output.</param>
        /// <param name="options">The option with <see cref="AbstractTester"/>.</param>
        /// <returns>Tracked intput/output.</returns>
        public IOConsole Track(IOConsole io, params Mixture[] options)
        {
            var input = new InputArgs();

            if (options.TryGet("interactive", out Mixture exists))
            {
                input.SetInteractive(exists);
            }

            if (inputs != null && inputs.Length > 0)
            {
                input.SetInputStream(CreateStream(inputs));
            }

            Initialize(options);
            io.SetInput(input);
            io.SetOutput(Output);

            return(io);
        }