public void MatchingRuleOnlyMatchesOnMethodsWithAttributes() { IMatchingRule rule = new AttributeDrivenPolicyMatchingRule(); Assert.IsTrue(rule.Matches(hasAttributeMethod.ImplementationMethodInfo)); Assert.IsFalse(rule.Matches(doesntHaveAttributeMethod.ImplementationMethodInfo)); }
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)); }
public void ShouldMatchInheritedHandlerAttributes() { IMatchingRule rule = new AttributeDrivenPolicyMatchingRule(); Assert.IsTrue(rule.Matches(newMethod.ImplementationMethodInfo)); }
public PerMethodAttributeDrivenPolicy() : base("Per Method Attribute Driven Policy") { _attributeMatchRule = new AttributeDrivenPolicyMatchingRule(); }
/// <summary> /// Constructs a new instance of the <see cref="AttributeDrivenPolicy"/>. /// </summary> public AttributeDrivenPolicy() : base("Attribute Driven Policy") { this.attributeMatchRule = new AttributeDrivenPolicyMatchingRule(); }
public void ShouldMatchInheritedHandlerAttributes() { IMatchingRule rule = new AttributeDrivenPolicyMatchingRule(); Assert.IsTrue(rule.Matches(aNewMethod)); }