public void Default_doesnt_support_mutually_exclusive_options() { var options = new OptionsWithMultipleSet(); bool result = Parser.Default.ParseArguments( new string[] { "-r1", "-g2", "-b3", "-h4", "-s5", "-v6" }, options); result.Should().BeTrue(); // enabling MutuallyExclusive option it would fails }
public void DefaultDoesntSupportMutuallyExclusiveOptions() { var options = new OptionsWithMultipleSet(); bool result = CommandLineParser.Default.ParseArguments( new string[] { "-r1", "-g2", "-b3", "-h4", "-s5", "-v6" }, options); result.Should().Be.True(); // enabling MutuallyExclusive option it would fails }
public void ParsingTwoMutuallyExclusiveOptionsInTwoSetSucceeds() { var options = new OptionsWithMultipleSet(); bool result = base.Parser.ParseArguments(new string[] { "-g167", "--hue", "205" }, options); base.AssertParserSuccess(result); Assert.AreEqual(167, options.Green); Assert.AreEqual(205, options.Hue); }
public void ParsingThreeMutuallyExclusiveOptionsInTwoSetFails() { var options = new OptionsWithMultipleSet(); bool result = base.Parser.ParseArguments(new string[] { "-g167", "--hue", "205", "--saturation=37" }, options); base.AssertParserFailure(result); }
public void Parsing_three_mutually_exclusive_options_in_two_set_fails() { var parser = new CommandLineParser(new CommandLineParserSettings {MutuallyExclusive = true}); var options = new OptionsWithMultipleSet(); var result = parser.ParseArguments(new string[] { "-g167", "--hue", "205", "--saturation=37" }, options); result.Should().BeFalse(); }
public void Parsing_two_mutually_exclusive_options_in_two_set_succeeds() { var options = new OptionsWithMultipleSet(); var parser = new CommandLineParser(new CommandLineParserSettings { MutuallyExclusive = true }); var result = parser.ParseArguments(new string[] { "-g167", "--hue", "205" }, options); result.Should().BeTrue(); options.Green.Should().Be((byte)167); options.Hue.Should().Be((short)205); }
public void ParsingTwoMutuallyExclusiveOptionsInTwoSetSucceeds() { var options = new OptionsWithMultipleSet(); Result = base.Parser.ParseArguments(new string[] { "-g167", "--hue", "205" }, options); ResultShouldBeTrue(); options.Green.Should().Equal((byte) 167); options.Hue.Should().Equal((short) 205); }
public void ParsingThreeMutuallyExclusiveOptionsInTwoSetFails() { var options = new OptionsWithMultipleSet(); Result = base.Parser.ParseArguments(new string[] { "-g167", "--hue", "205", "--saturation=37" }, options); ResultShouldBeFalse(); }