Esempio n. 1
0
        public void ShouldMatchPolicyWithRules()
        {
            Policy policy = new Policy("DALPolicy");

            policy.RuleSet.Add(new TypeMatchingAssignmentRule(typeof(MockDal)));
            ExceptionSwizzlerHandler handler = new ExceptionSwizzlerHandler();

            policy.Handlers.Add(handler);

            Assert.IsTrue(policy.AppliesTo(typeof(MockDal)));
            Assert.IsTrue(policy.Handlers.Contains(handler));
        }
Esempio n. 2
0
        public void ShouldNotMatchPolicyWithNoRules()
        {
            Policy policy = new Policy("DALPolicy");

            Assert.IsFalse(policy.AppliesTo(typeof(MockDal)));
        }