コード例 #1
0
ファイル: OptionContextTest.cs プロジェクト: Schumix/Schumix2
        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
ファイル: OptionTest.cs プロジェクト: Schumix/Schumix2
 protected override void OnParseComplete(OptionContext c)
 {
     throw new NotImplementedException();
 }
コード例 #3
0
ファイル: Category.cs プロジェクト: Schumix/Schumix2
 protected override void OnParseComplete(OptionContext c)
 {
     throw new NotSupportedException("Category.OnParseComplete should not be invoked.");
 }
コード例 #4
0
ファイル: ActionOption.cs プロジェクト: Schumix/Schumix2
 protected override void OnParseComplete(OptionContext c)
 {
     action(c.OptionValues);
 }