public void CmdArgs_Help2() { var settings = new Args2(); var parser = ArgumentParser.Parse(new[] { "?" }, settings); Assert.IsTrue(parser.IsHelp); var help = parser.GetHelpText(); Assert.AreEqual(Args2.GetExpectedHelpText().Trim(), help.Trim()); }
public void CmdArgs_Error_HelpFromException() { var args = new[] { "-PROFILE:asdf:5,qwer:3", "-u", "asdf" }; var settings = new Args2(); try { ArgumentParser.Parse(args, settings); Assert.Fail(); // must have an error } catch (ParsingException e) { Assert.AreEqual(Args2.GetExpectedHelpText().Trim(), e.Result.GetHelpText().Trim()); } }