private void GetServices() { processingErrors = new List <CommandLineErrorEventArgs>(); registrationErrors = new List <CommandLineErrorEventArgs>(); processor = container.Resolve <ICommandLineProcessorService>(); processor.CommandRegistrationError += Processor_CommandRegistrationError; processor.ProcessInputError += Processor_ProcessInputError; applicationMock = container.Resolve <ITestApplication>(); commandHistoryWriterMock = container.Resolve <ITestCommandHistoryWriter>(); }
public void SetUp() { validCommands = MockCommandGenerator.GenerateValidCommandCollection().ToList(); processorMock = Substitute.For <ICommandLineProcessorService>(); processorMock.ActiveCommand.Returns(x => activeCommandMock); processorMock.Settings = new CommandLineSettings { CommandPromptRoot = CommandRoot }; activeCommandMock = null; systemUnderTest = new InputHandlerProvider(); systemUnderTest.Processor = processorMock; }
public CommandLineInterface( ICommandLineProcessorService commandLineProcessor, IInputHandlerService inputHandler, ICommandHistoryWriter historyWriter) { this.commandLineProcessor = commandLineProcessor; this.inputHandler = inputHandler; this.inputHandler.Processor = this.commandLineProcessor; this.historyWriter = historyWriter; keyedCharacters = new List <char>(); keyedCharacterIndex = -1; Console.TreatControlCAsInput = true; }