예제 #1
0
 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;
 }
예제 #3
0
 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;
 }