コード例 #1
0
        public void MatchingRuleOnlyMatchesOnMethodsWithAttributes()
        {
            IMatchingRule rule = new AttributeDrivenPolicyMatchingRule();

            Assert.IsTrue(rule.Matches(hasAttributeMethod.ImplementationMethodInfo));
            Assert.IsFalse(rule.Matches(doesntHaveAttributeMethod.ImplementationMethodInfo));
        }
コード例 #2
0
        public void MatchingRuleMatchesForAllMethodsInAttributeTestTarget()
        {
            IMatchingRule rule = new AttributeDrivenPolicyMatchingRule();

            Assert.IsTrue(rule.Matches(nothingSpecialMethod.ImplementationMethodInfo));
            Assert.IsTrue(rule.Matches(doSomethingMethod.ImplementationMethodInfo));
            Assert.IsTrue(rule.Matches(getCriticalInfoMethod.ImplementationMethodInfo));
            Assert.IsTrue(rule.Matches(mustBeFastMethod.ImplementationMethodInfo));
        }
コード例 #3
0
        public void ShouldMatchInheritedHandlerAttributes()
        {
            IMatchingRule rule = new AttributeDrivenPolicyMatchingRule();

            Assert.IsTrue(rule.Matches(newMethod.ImplementationMethodInfo));
        }
コード例 #4
0
 public PerMethodAttributeDrivenPolicy() : base("Per Method Attribute Driven Policy")
 {
     _attributeMatchRule = new AttributeDrivenPolicyMatchingRule();
 }
コード例 #5
0
 /// <summary>
 /// Constructs a new instance of the <see cref="AttributeDrivenPolicy"/>.
 /// </summary>
 public AttributeDrivenPolicy()
     : base("Attribute Driven Policy")
 {
     this.attributeMatchRule = new AttributeDrivenPolicyMatchingRule();
 }
コード例 #6
0
        public void ShouldMatchInheritedHandlerAttributes()
        {
            IMatchingRule rule = new AttributeDrivenPolicyMatchingRule();

            Assert.IsTrue(rule.Matches(aNewMethod));
        }