public static void UnParsing_instance_with_group_switches_returns_command_line_with_switches_grouped()
 {
     var options = new Options_With_Switches { InputFile = "input.bin", HumanReadable = true, IgnoreWarnings = true };
     new Parser()
         .FormatCommandLine(options, config => config.GroupSwitches = true)
         .ShouldBeEquivalentTo("-hi --input input.bin");
 }
Exemplo n.º 2
0
        public void Parse_options_with_single_dash()
        {
            // Fixture setup
            var args = new[] {"-"};
            var expectedOptions = new Options_With_Switches();
            var sut = new Parser();

            // Exercize system
            var result = sut.ParseArguments<Options_With_Switches>(args);

            // Verify outcome
            ((Parsed<Options_With_Switches>)result).Value.ShouldBeEquivalentTo(expectedOptions);
            // Teardown
        }
Exemplo n.º 3
0
        public void Parse_options_with_short_name(string outputFile, string[] args)
        {
            // Fixture setup
            var expectedOptions = new Options_With_Switches { OutputFile = outputFile };
            var sut = new Parser();

            // Exercize system
            var result = sut.ParseArguments<Options_With_Switches>(args);

            // Verify outcome
            ((Parsed<Options_With_Switches>)result).Value.ShouldBeEquivalentTo(expectedOptions);
            // Teardown
        }