public void Parse_verbs_using_generic_overload() { // Fixture setup var expectedOptions = new CloneOptions { Quiet = true, Urls = new[] { "http://gsscoder.github.com/", "http://yes-to-nooo.github.com/" } }; var sut = new Parser(); // Exercize system var result = sut.ParseArguments<AddOptions, CommitOptions, CloneOptions>( new[] { "clone", "-q", "http://gsscoder.github.com/", "http://yes-to-nooo.github.com/" }); // Verify outcome Assert.IsType<CloneOptions>(result.Value); result.Value.ShouldHave().AllRuntimeProperties().EqualTo(expectedOptions); Assert.False(result.Errors.Any()); // Teardown }
public void Parse_verbs_using_generic_overload() { // Fixture setup var expectedOptions = new CloneOptions { Quiet = true, Urls = new[] { "http://gsscoder.github.com/", "http://yes-to-nooo.github.com/" } }; var sut = new Parser(); // Exercize system var result = sut.ParseArguments<AddOptions, CommitOptions, CloneOptions>( new[] { "clone", "-q", "http://gsscoder.github.com/", "http://yes-to-nooo.github.com/" }); // Verify outcome Assert.IsType<CloneOptions>(result.Value); result.Value.ShouldBeEquivalentTo(expectedOptions, o => o.RespectingRuntimeTypes()); // Teardown }
public void Parse_verbs() { // Fixture setup var expectedOptions = new CloneOptions { Quiet = true, Urls = new[] { "http://gsscoder.github.com/", "http://yes-to-nooo.github.com/" } }; var sut = new Parser(); // Exercize system var result = sut.ParseArguments( new[] { "clone", "-q", "http://gsscoder.github.com/", "http://yes-to-nooo.github.com/" }, typeof(AddOptions), typeof(CommitOptions), typeof(CloneOptions)); // Verify outcome Assert.IsType<CloneOptions>(((Parsed<object>)result).Value); ((Parsed<object>)result).Value.ShouldBeEquivalentTo(expectedOptions, o => o.RespectingRuntimeTypes()); // Teardown }