public void ParsingTwoMutuallyExclusiveOptionsFails() { var options = new OptionsWithDefaultSet(); bool result = base.Parser.ParseArguments(new string[] { "-i", "1", "--file=mystuff.xml" }, options); base.AssertParserFailure(result); }
public void ParsingOneMutuallyExclusiveOptionSucceeds() { var options = new OptionsWithDefaultSet(); bool result = base.Parser.ParseArguments(new string[] { "--file=mystuff.xml" }, options); base.AssertParserSuccess(result); Assert.AreEqual("mystuff.xml", options.FileName); }
public void ParsingOneMutuallyExclusiveOptionSucceeds() { var options = new OptionsWithDefaultSet(); Result = base.Parser.ParseArguments(new string[] { "--file=mystuff.xml" }, options); ResultShouldBeTrue(); options.FileName.Should().Equal("mystuff.xml"); }
public void Parsing_one_mutually_exclusive_option_succeeds() { var options = new OptionsWithDefaultSet(); var parser = new CommandLineParser(new CommandLineParserSettings {MutuallyExclusive = true}); var result = parser.ParseArguments(new string[] { "--file=mystuff.xml" }, options); result.Should().BeTrue(); options.FileName.Should().Be("mystuff.xml"); }
public void Parsing_two_mutually_exclusive_options_fails() { var parser = new CommandLineParser(new CommandLineParserSettings { MutuallyExclusive = true }); var options = new OptionsWithDefaultSet(); var result = parser.ParseArguments(new string[] { "-i", "1", "--file=mystuff.xml" }, options); result.Should().BeFalse(); }
public void ParsingTwoMutuallyExclusiveOptionsFails() { var options = new OptionsWithDefaultSet(); Result = base.Parser.ParseArguments(new string[] { "-i", "1", "--file=mystuff.xml" }, options); ResultShouldBeFalse(); }
public void ParsingOneMutuallyExclusiveOptionWithAnotherOptionSucceeds() { var options = new OptionsWithDefaultSet(); Result = base.Parser.ParseArguments(new string[] { "--file=mystuff.xml", "-v" }, options); ResultShouldBeTrue(); Assert.AreEqual("mystuff.xml", options.FileName); Assert.AreEqual(true, options.Verbose); }