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); }
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); }