CommandLineApplicationTests.cs (66)
29var result = app.Execute("test");
49app.Execute("test", "one", "two");
70var ex = Assert.Throws<CommandParsingException>(() => app.Execute("test", "one", "two", "three"));
91app.Execute("test", "one", "two", "three");
111var ex = Assert.Throws<CommandParsingException>(() => app.Execute("test2", "one", "two", "three"));
129app.Execute("test", "one", "two", "three", "four", "five");
151app.Execute("test", "one", "two", "three", "four", "five");
184app.Execute("test", "--first", "one", "--second", "two");
203var ex = Assert.Throws<CommandParsingException>(() => app.Execute("test", "--first"));
223app.Execute("test", "--first=one", "--second:two");
244app.Execute("test", "-1=one", "-2", "two");
261var exception = Assert.Throws<CommandParsingException>(() => app.Execute("test", unexpectedArg));
278app.Execute("test", unexpectedArg);
290app.Execute("one", "--first");
303app.Execute("--first", "one");
316app.Execute("one", "--first", "two");
329app.Execute("--first", "one", "two");
343app.Execute(arguments);
357app.Execute(unexpectedArg, "--first");
372app.Execute("--first", unexpectedArg);
387app.Execute(arguments);
400app.Execute(unexpectedArg, "--first", "one");
415app.Execute("--first", "one", unexpectedArg);
433var exception = Assert.Throws<CommandParsingException>(() => app.Execute("test", unexpectedOption));
450app.Execute("test", unexpectedOption);
463app.Execute(arguments);
476app.Execute(unexpectedOption, "--first");
491app.Execute("--first", unexpectedOption);
506app.Execute(arguments);
519app.Execute(unexpectedOption, "--first", "one");
534app.Execute("--first", "one", unexpectedOption);
549app.Execute(arguments);
563app.Execute(unexpectedOption, unexpectedValue, "--first");
578app.Execute("--first", unexpectedOption, unexpectedValue);
593app.Execute(unexpectedOption, unexpectedValue, "--first", "one");
609app.Execute(unexpectedOption, unexpectedValue, "--first", "one");
626app.Execute("--first", "one", unexpectedOption, unexpectedValue);
643var exception = Assert.Throws<CommandParsingException>(() => app.Execute("test", unexpectedOption));
660app.Execute("test", unexpectedOption);
676var exception = Assert.Throws<CommandParsingException>(() => app.Execute("test", unexpectedOption));
693app.Execute("test", unexpectedOption);
711var exception = Assert.Throws<CommandParsingException>(() => app.Execute("k", unexpectedOption, "run"));
730app.Execute("k", unexpectedOption, "run");
751app.Execute("k", "run", unexpectedOption);
768app.Execute(arguments);
783app.Execute(unexpectedOption, "run");
811app.Execute("-a", "A1", "subcmd");
814Assert.Throws<CommandParsingException>(() => app.Execute("subcmd", "-b", "B"));
829Assert.Throws<InvalidOperationException>(() => app.Execute("subcmd", "-a", "b"));
843app.Execute("-a", "top");
849app.Execute("subcmd", "-a", "nested");
891Assert.Throws<CommandParsingException>(() => app.Execute("--nest2", "N2", "--nest1", "N1", "-g", "G"));
892Assert.Throws<CommandParsingException>(() => app.Execute("lvl1", "--nest2", "N2", "--nest1", "N1", "-g", "G"));
894app.Execute("lvl1", "lvl2", "--nest2", "N2", "-g", "G", "--nest1", "N1");
919app.Execute(input);
947app.Execute(input);
974app.Execute(input);
1001app.Execute(input);
1095app.Execute(input);
1117var exception = Assert.Throws<CommandParsingException>(() => app.Execute(inputOptions));
1130app.Execute(input);
1143var exception = Assert.Throws<CommandParsingException>(() => app.Execute(inputOption));
1154var exception = Assert.Throws<CommandParsingException>(() => app.Execute(inputOption));
1165var exception = Assert.Throws<CommandParsingException>(() => app.Execute(inputOption));
1196app.Execute("test", firstUnmatchedOption, firstActualOption, seconUnmatchedOption, secondActualOption);
1219var exception = Assert.Throws<CommandParsingException>(() => app.Execute("test", firstOption));