public void Parse_options_with_double_dash_in_verbs_scenario() { // Fixture setup var expectedOptions = new Add_Verb { Patch = true, FileName = "--strange-fn" }; var sut = new Parser(with => with.EnableDashDash = true); // Exercize system var result = sut.ParseArguments( new[] { "add", "-p", "--", "--strange-fn" }, typeof(Add_Verb), typeof(Commit_Verb), typeof(Clone_Verb)); // Verify outcome Assert.IsType<Add_Verb>(((Parsed<object>)result).Value); ((Parsed<object>)result).Value.ShouldBeEquivalentTo(expectedOptions, o => o.RespectingRuntimeTypes()); // Teardown }
public static void UnParsing_instance_returns_command_line_for_verbs(Add_Verb verb, string result) { new Parser() .FormatCommandLine(verb) .ShouldBeEquivalentTo(result); }
public void Parse_existing_verb_returns_verb_instance() { // Fixture setup var expected = new Add_Verb { Patch = true, FileName = "dummy.bin"}; // Exercize system var result = InvokeChoose( new[] { typeof(Add_Verb), typeof(Commit_Verb), typeof(Clone_Verb) }, new[] { "add", "--patch", "dummy.bin" }); // Verify outcome Assert.IsType<Add_Verb>(((Parsed<object>)result).Value); expected.ShouldBeEquivalentTo(((Parsed<object>)result).Value); // Teardown }