public void ShouldMatchMultipleMethods() { IMatchingRule rule = new MemberNameMatchingRule( new string[] { "MethodTwo", "Save" }); Assert.IsFalse(rule.Matches(methodOne)); Assert.IsTrue(rule.Matches(methodTwo)); Assert.IsTrue(rule.Matches(save)); }
public void MemberNameMatchingRuleMatchesNameInDoubleDerivedClass() { var rule = new MemberNameMatchingRule("DoSomething"); MethodInfo memberInfo = typeof(DoubleDerivedClass).GetMethod("DoSomething"); Assert.IsTrue(rule.Matches(memberInfo)); }
public void ShouldMatchWithWildcard() { MemberNameMatchingRule rule = new MemberNameMatchingRule("*Reset"); foreach (MethodInfo method in new MethodInfo[] { reset, closeAndReset }) { Assert.IsTrue(rule.Matches(method), "Match failed for method {0}", method.Name); } }
public void ShouldMatchMultipleWildcards() { IMatchingRule rule = new MemberNameMatchingRule( new string[] { "Method*", "*Reset" }); foreach (MethodInfo method in new MethodInfo[] { methodOne, methodTwo, reset, closeAndReset }) { Assert.IsTrue(rule.Matches(method), "Match failed for method {0}", method.Name); } }
public void ShouldMatchExactName() { MemberNameMatchingRule rule = new MemberNameMatchingRule("Save"); Assert.IsTrue(rule.Matches(save)); }