public void EmptyCommandLineTest() { Assert.Throws <ArgvParserException>(() => { ArgvParser.GetCommandLine(new string[] {}); }); Assert.Throws <ArgvParserException>(() => { ArgvParser.GetCommandLine(new List <string>()); }); Assert.Throws <ArgvParserException>( () => { ArgvParser.GetCommandLine(new List <string>().AsEnumerable()); }); }
public void SimpleCommand() { var argv = new[] { "cmd.exe", "/c", @"C:\Windows\System32\notepad.exe" }; var cmdline = ArgvParser.GetCommandLine(argv); Assert.Equal("cmd.exe", cmdline.Executable); argv = argv.Skip(1).ToArray(); var parsed = ProcessRunner.GetArgs(cmdline.Arguments); Assert.Equal(argv, parsed); }
public void NullCommandLineTest() { Assert.Throws <ArgvParserException>(() => { ArgvParser.GetCommandLine(null); }); }