示例#1
0
        public static void UnParsing_instance_with_default_values_when_skip_default_is_true(bool skipDefault, string expected)
        {
            var options = new Options_With_Defaults {
                P2 = "xyz", P1 = 99, P3 = 88, P4 = Shapes.Square
            };

            new Parser()
            .FormatCommandLine(options, x => x.SkipDefault = skipDefault)
            .Should().BeEquivalentTo(expected);
        }
示例#2
0
        public static void UnParsing_instance_with_default_values_when_skip_default_is_false()
        {
            var options = new Options_With_Defaults {
                P2 = "xyz", P1 = 99, P3 = 88, P4 = Shapes.Square
            };

            new Parser()
            .FormatCommandLine(options)
            .Should().BeEquivalentTo("--p1 99 --p2 xyz --p3 88 --p4 Square");
        }