public void StopsParsingAfterVersions() { string output; var result = TestHelper.ParseArguments <SimpleArgs>("-Value test --version -name", out output); Assert.IsNull(result); }
public void ParamDetailsUsed() { string output; var result = TestHelper.ParseArguments <ClassWithHelp>("--help", out output); Assert.IsTrue(output.Contains("A name to use")); }
public void HelpDefaultsToProgramName() { string output; var result = TestHelper.ParseArguments <NormalNoHelp>("--help", out output); Assert.IsTrue(output.Contains("UnitTests")); }
public void ParsesVersion() { string output; var result = TestHelper.ParseArguments <SimpleArgs>("--version", out output); Assert.IsNull(result); }
public void SynopsisIsUsed() { string output; var result = TestHelper.ParseArguments <ClassWithHelp>("--help", out output); Assert.IsTrue(output.Contains("Sample usage of help attributes")); Assert.IsFalse(output.Contains("UnitTests")); }
public void HelpDetected() { string output; var result = TestHelper.ParseArguments <NormalNoHelp>("--help", out output); Assert.IsNull(result); Assert.IsFalse(output.Contains("No switch named ")); }
public void ShowsDetailedDescription() { string output; var result = TestHelper.ParseArguments <ClassWithHelp>("--help", out output); Assert.IsTrue(output.Contains("Detailed class information")); Assert.IsTrue(output.Contains("Detailed information")); }
public void DoesntParseArguments() { string output; var result = TestHelper.ParseArguments <NormalNoHelp>("-Value one --help -NameSpeltWrong", out output); Assert.IsNull(result); Assert.IsFalse(output.Contains("No switch named ")); Assert.IsFalse(output.Contains("The value specified for")); }
public void ShowsVersion() { string output; var result = TestHelper.ParseArguments <SimpleArgs>("-Value test --version -name", out output); Assert.IsTrue(output.Contains("1.0.0.0")); Assert.IsFalse(output.Contains("1.2.0.0")); Assert.IsTrue(output.Contains("UnitTests")); }
public void SyntaxIsShown() { string output; var result = TestHelper.ParseArguments <ClassWithHelp>("--help", out output); Assert.IsTrue(output.Contains("[Name System.String]")); Assert.IsTrue(output.Contains("[Value System.Int32]")); Assert.IsTrue(output.Contains("Required System.String")); Assert.IsFalse(output.Contains("[Required System.String]")); Assert.IsTrue(output.Contains("[[Positional] System.Int32]")); Assert.IsTrue(output.Contains("[PositionalAndRequired] System.Single")); Assert.IsFalse(output.Contains("[[PositionalAndRequired] System.Single]")); Assert.IsTrue(output.IndexOf("[[Positional] System.Int32]") < output.IndexOf("[PositionalAndRequired] System.Single")); }