public void CanCreateInstance() { var args = new string[] {}; var interpreter = new CommandLineInterpreter(args); Assert.That(interpreter, Is.Not.Null); }
public DirectoryProcessor(CommandLineInterpreter interpreter, FileProcessor fileProcessor, IInvokeProcess processInvoker) { _interpreter = interpreter; _processInvoker = processInvoker; _fileProcessor = fileProcessor; }
private static void Main(string[] args) { var interpreter = new CommandLineInterpreter(args); var invoker = new ProcessInvoker(); var fileProcessor = new FileProcessor(invoker); var processor = new DirectoryProcessor(interpreter, fileProcessor, invoker); processor.Process(); }
public void Can_Return_Expected_CommandLine() { var interpreter = new CommandLineInterpreter(new[] { "-startPath", @"c:\", "-eachfile", "-continueOnError", @"c:\test\process.exe", "/s", "/e" }); AssertThat_Interpreter_IsSetupCorrectly(interpreter); }
public void Can_Return_Expected_CommandLine() { var interpreter = new CommandLineInterpreter(new[] {"-eachFile", @"c:\test\process.exe", "/s", "/e"}); AssertThat_Interpreter_IsSetupCorrectly(interpreter); }
public void Reports_Proper_Continue_On_Error_Status(string arg, string failureMessage) { var interpreter = new CommandLineInterpreter(new[] {arg}); Assert.That(interpreter.ContinueOnError, Is.True, failureMessage); }
private static void AssertThat_Interpreter_IsSetupCorrectly(CommandLineInterpreter interpreter) { Assert.That(interpreter.ProcessToExecute.FileName, Is.EqualTo(@"c:\test\process.exe")); Assert.That(interpreter.ProcessToExecute.Arguments, Is.EqualTo("/s /e")); }
public void Reports_Proper_Start_Folder() { const string PATH = @"c:\"; var interpreter = new CommandLineInterpreter(new[] {"-startpath", PATH}); Assert.That(interpreter.StartDirectory, Is.EqualTo(PATH)); }
public void Reports_Invalid_Folder() { const string PATH = @"c:\this_folder_does_not_exist"; Assert.That(Directory.Exists(PATH), Is.False, "PRECONDITION: Directory " + PATH + " should not exist!"); var interpreter = new CommandLineInterpreter(new[] {"-startpath", PATH}); string temp; Assert.Throws<ArgumentException>(() => temp = interpreter.StartDirectory); }