コード例 #1
0
        public RuleActivationState GetActivationState(IRuleContext context, IRule rule){
            if (!rule.IsWithCountHints()){
                return RuleActivationState.Always();
            }
            if (-1 != rule.GetMaxExecCountHint()){
                if (context.execCount(rule) == rule.GetMaxExecCountHint()){
                    return RuleActivationState.Never();
                }
            }

            if (-1 != rule.GetMaxBadTestCountHint()){
                if (context.badCount(rule) == rule.GetMaxBadTestCountHint()){
                    return RuleActivationState.Never();
                }
            }
            return new RuleActivationState(RuleActivationStateType.Active);
        }