public void ParseShortLongOptions() { var options = new BooleanSetOptions(); bool result = base.Parser.ParseArguments(new string[] { "-b", "--double=9" }, options); base.AssertParserSuccess(result); Assert.IsTrue(options.BooleanTwo); Assert.IsFalse(options.BooleanOne); Assert.IsFalse(options.BooleanThree); Assert.AreEqual(9, options.NonBooleanValue); Console.WriteLine(options); }
public void Parse_short_long_options() { var options = new BooleanSetOptions(); var parser = new CommandLine.Parser(); var result = parser.ParseArguments(new string[] { "-b", "--double=9" }, options); result.Should().BeTrue(); options.BooleanTwo.Should().BeTrue(); options.BooleanOne.Should().BeFalse(); options.BooleanThree.Should().BeFalse(); options.NonBooleanValue.Should().Be(9D); Console.WriteLine(options); }