public void CustomAttributeRuleDoesNotSearchInheritanceChainWhenInheritedIsFalse() { MethodInfo method = typeof(DerivedObject).GetMethod("MethodWithAttribute"); CustomAttributeMatchingRule rule = new CustomAttributeMatchingRule(typeof(RandomAttribute), false); Assert.IsFalse(rule.Matches(method)); }
public void CustomAttributeRuleDeniesMatchWhenNoAttributeFound() { MethodInfo method = typeof(TestObject).GetMethod("MethodWithoutAttribute"); CustomAttributeMatchingRule rule = new CustomAttributeMatchingRule(typeof(RandomAttribute), false); Assert.IsFalse(rule.Matches(method)); }
public void CustomAttributeRuleMatchesWhenAttributeFuond() { MethodInfo method = typeof(TestObject).GetMethod("MethodWithAttribute"); CustomAttributeMatchingRule rule = new CustomAttributeMatchingRule(typeof(RandomAttribute), false); Assert.IsTrue(rule.Matches(method)); }