Exemple #1
0
 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()); });
 }
Exemple #2
0
        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);
        }
Exemple #3
0
 public void NullCommandLineTest()
 {
     Assert.Throws <ArgvParserException>(() => { ArgvParser.GetCommandLine(null); });
 }