Example #1
0
        public void Parse_short_long_options()
        {
            var options = new BooleanSetOptions();
            var parser = new 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);
        }
Example #2
0
        public void Parse_short_adjacent_options()
        {
            var options = new BooleanSetOptions();
            var parser = new CommandLine.Parser();
            var result = parser.ParseArguments(new string[] { "-ca", "-d65" }, options);

            result.Should().BeTrue();
            options.BooleanThree.Should().BeTrue();
            options.BooleanOne.Should().BeTrue();
            options.BooleanTwo.Should().BeFalse();
            options.NonBooleanValue.Should().Be(65D);
            Console.WriteLine(options);
        }