示例#1
0
 protected ReturnRuleDecorator(ReturnRule rule)
 {
     if (rule == null)
     {
         throw new ArgumentNullException(nameof(rule));
     }
     Rule = rule;
 }
 public TBuilder MatchMethod(
     ReturnRule returnRule, params ArgumentRule[] args)
 {
     if (returnRule == null)
     {
         throw new ArgumentNullException(nameof(returnRule));
     }
     if (returnRule.GetSubRule <ReturnAsync>() == null)
     {
         returnRule = new ReturnAsync(returnRule, false);
     }
     Policy.AddMethodRule(new MethodRule(Policy.BindMethod, returnRule, args));
     return((TBuilder)this);
 }
示例#3
0
 public ReturnVoid(ReturnRule rule) : base(rule)
 {
 }
示例#4
0
 public MethodRule(MethodBinder binder, ReturnRule returnValue,
                   params ArgumentRule[] args)
     : this(binder, args)
 {
     _returnValue = returnValue;
 }
示例#5
0
 public ReturnAsync(ReturnRule rule, bool required = true)
     : base(rule)
 {
     _required = required;
 }