示例#1
0
        public void Exceptions()
        {
            if(sPlatform.IsWindows)
                return;

            OptionSet p = new OptionSet() {
                { "a=", v => { /* ignore */ } },
            };
            OptionContext c = new OptionContext(p);
            Utils.AssertException(typeof(InvalidOperationException), "OptionContext.Option is null.", c, v => {
                string ignore = v.OptionValues[0]; });
            c.Option = p[0];
            Utils.AssertException(typeof(ArgumentOutOfRangeException), "Argument is out of range.\nParameter name: index", c, v => {
                string ignore = v.OptionValues[2]; });
            c.OptionName = "-a";
            Utils.AssertException(typeof(OptionException), "Missing required value for option '-a'.", c, v => {
                string ignore = v.OptionValues[0]; });
        }
示例#2
0
 protected override void OnParseComplete(OptionContext c)
 {
     throw new NotImplementedException();
 }
示例#3
0
 protected override void OnParseComplete(OptionContext c)
 {
     throw new NotSupportedException("Category.OnParseComplete should not be invoked.");
 }
示例#4
0
 protected override void OnParseComplete(OptionContext c)
 {
     action(c.OptionValues);
 }