Пример #1
0
        private RuleDrivenPolicy GetPolicyThatMatchesInterface()
        {
            RuleDrivenPolicy           policy = new RuleDrivenPolicy("Matches IDal");
            TypeMatchingAssignmentRule rule   = new TypeMatchingAssignmentRule(typeof(IDal));

            countHandler = new CallCountHandler();
            policy.RuleSet.Add(rule);
            policy.Handlers.Add(countHandler);
            return(policy);
        }
Пример #2
0
        private RuleDrivenPolicy GetShortcutPolicy( )
        {
            RuleDrivenPolicy           typeMatchPolicy = new RuleDrivenPolicy("ShortcutPolicy");
            TypeMatchingAssignmentRule typeRule        = new TypeMatchingAssignmentRule(typeof(MockDal));

            typeMatchPolicy.RuleSet.Add(typeRule);
            ShortcuttingHandler handler = new ShortcuttingHandler("shortcut");

            typeMatchPolicy.Handlers.Add(handler);
            return(typeMatchPolicy);
        }