public void HelpOptionParameterTest(string[] param) { var result = new StandaloneCliOptionsTest(param); result.ExitCode .Should() .Be(0); }
public void MissingOptionParameterTest(params string[] param) { var result = new StandaloneCliOptionsTest(param); result.ExitCode.Should().Be(160); result.Warnings.Count.Should().Be(1); result.Warnings[0].Should().Be($"Parse args exception: Missing required value for option '{param[0]}'."); }
public void LegacyOptionTest(string cliOption, string[] param) { var result = new StandaloneCliOptionsTest(param); result.Count.Should().Be(0); result.Warnings.Count.Should().Be(1); result.Warnings[0].Should().Be( "Legacy option {option} not supported, please use -h option to get all the supported options." + "::" + cliOption ); }
public void UnsupportedOptionTest(params string[] param) { var result = new StandaloneCliOptionsTest(param); result.Count.Should().Be(0); result.Warnings.Count.Should().Be(param.Length); for (var i = 0; i < result.Warnings.Count; ++i) { var warning = result.Warnings[i]; warning.Should().Be( "Option {option} wrong or not supported, please use -h option to get all the supported options." + "::" + param[i] ); } }