コード例 #1
0
        public void ParseOptionsWithDefaultArray()
        {
            var options = new SimpleOptionsWithDefaultArray();
            bool result = base.Parser.ParseArguments(new string[] { "-y", "4", "5", "6" }, options);

            base.AssertParserSuccess(result);
            Assert.AreEqual(new string[] { "a", "b", "c" }, options.StringArrayValue);
            Assert.AreEqual(new int[] { 4, 5, 6 }, options.IntegerArrayValue);
            Assert.AreEqual(new double[] { 1.1, 2.2, 3.3 }, options.DoubleArrayValue);
        }
コード例 #2
0
        public void ParseOptionsWithDefaultArray()
        {
            var options = new SimpleOptionsWithDefaultArray();
            Result = base.Parser.ParseArguments(new string[] { "-y", "4", "5", "6" }, options);

            ResultShouldBeTrue();
            options.StringArrayValue.Should().Equal(new string[] { "a", "b", "c" });
            options.IntegerArrayValue.Should().Equal(new int[] { 4, 5, 6 });
            options.DoubleArrayValue.Should().Equal(new double[] { 1.1, 2.2, 3.3 });
        }
コード例 #3
0
        public void Parse_options_with_default_array()
        {
            var options = new SimpleOptionsWithDefaultArray();
            var parser = new CommandLineParser();
            var result = parser.ParseArguments(new [] { "-y", "4", "5", "6" }, options);

            result.Should().BeTrue();
            options.StringArrayValue.Should().Equal(new [] { "a", "b", "c" });
            options.IntegerArrayValue.Should().Equal(new [] { 4, 5, 6 });
            options.DoubleArrayValue.Should().Equal(new [] { 1.1, 2.2, 3.3 });
        }