public void Initialize() { _autoCompleteHandler = new AutoCompleteHandler(); _completions = _autoCompleteHandler.GetSuggestions("", 0); _history = new List <string>(new[] { "dotnet run", "git init", "clear" }); _console = new Console2(); _keyHandler = new KeyHandler(_console, _history, null); "Hello".Select(c => c.ToConsoleKeyInfo()) .ToList() .ForEach(_keyHandler.Handle); }
public KeyHandlerTests() { _autoCompleteHandler = new AutoCompleteHandler(); _completions = _autoCompleteHandler.GetSuggestions("", 0); _history = new List <string>(new string[] { "dotnet run", "git init", "clear" }); _keyHandler = new KeyHandler(new Console2(), _history, null); _keyInfo = new ConsoleKeyInfo('H', ConsoleKey.H, false, false, false); _keyHandler.Handle(_keyInfo); _keyInfo = new ConsoleKeyInfo('e', ConsoleKey.E, false, false, false); _keyHandler.Handle(_keyInfo); _keyInfo = new ConsoleKeyInfo('l', ConsoleKey.L, false, false, false); _keyHandler.Handle(_keyInfo); _keyInfo = new ConsoleKeyInfo('l', ConsoleKey.L, false, false, false); _keyHandler.Handle(_keyInfo); _keyInfo = new ConsoleKeyInfo('o', ConsoleKey.O, false, false, false); _keyHandler.Handle(_keyInfo); }