public void Accept_Returns_Null_On_UnhandledInput(string input) { var option = new JoinedOption(1, "-", "foo"); int idx = 0; var arg = option.Accept(new[] { input }, ref idx); Assert.Equal(0, idx); Assert.Null(arg); }
public void Alias(string input, string spelling) { var option = new JoinedOption(1, new[] { "-", "/", "--" }, "foo:"); var option2 = new JoinedOption(2, new[] { "-", "/", "--" }, "foo=", aliasId: 1); var optTable = new OptTable(new[] { option, option2 }); int idx = 0; var arg = option2.Accept(new[] { input }, ref idx); Assert.NotNull(arg); Assert.Equal(1, arg.Option.Id); Assert.Equal(spelling, arg.Spelling); Assert.Equal("bar", arg.Value); }
public void Accept(string input, string value) { var option = new JoinedOption(1, "-", "foo"); int idx = 0; var arg = option.Accept(new[] { input }, ref idx); Assert.Equal(1, idx); Assert.NotNull(arg); Assert.Same(option, arg.Option); Assert.Equal(0, arg.Index); Assert.False(arg.IsClaimed); Assert.Equal("-foo", arg.Spelling); Assert.Equal(value, arg.Value); }