private static ConsoleReader CreateReader(IEnumerable <ConsoleKeyInfo> keyStream = null, ConsoleCompletionHandler completionHandler = null) { var consoleOutput = new SimulatedConsoleOutput(); var consoleInput = new SimulatedConsoleInput(keyStream ?? Enumerable.Empty <ConsoleKeyInfo>()); var input = Substitute.For <IConsoleLineInput>(); return(new ConsoleReader(input, consoleInput, consoleOutput, null)); }
private static ConsoleReader CreateReader(IEnumerable <ConsoleKeyInfo> keyStream, ConsoleCompletionHandler completionHandler = null) { var consoleOutput = new SimulatedConsoleOutput(); var consoleInput = new SimulatedConsoleInput(keyStream); var input = new ConsoleLineInput(consoleOutput, new ConsoleInputBuffer(), new ConsoleHistory(), completionHandler); return(new ConsoleReader(input, consoleInput, consoleOutput, null)); }
private static ConsoleReader CreateReader(IEnumerable <ConsoleKeyInfo> keyStream, ITokenCompleter tokenCompleter = null) { var consoleOutput = new SimulatedConsoleOutput(); var consoleInput = new SimulatedConsoleInput(keyStream); var input = new ConsoleLineInput(consoleOutput, new ConsoleInputBuffer(), new ConsoleHistory()) { TokenCompleter = tokenCompleter }; return(new ConsoleReader(input, consoleInput, consoleOutput, null)); }
private static ConsoleReader CreateReader(IEnumerable<ConsoleKeyInfo> keyStream, ConsoleCompletionHandler completionHandler = null) { var consoleOutput = new SimulatedConsoleOutput(); var consoleInput = new SimulatedConsoleInput(keyStream); var input = new ConsoleLineInput(consoleOutput, new ConsoleInputBuffer(), new ConsoleHistory(), completionHandler); return new ConsoleReader(input, consoleInput, consoleOutput, null); }