protected void NoPatternSuppliedTests(AbstractRegularExpressionMethodPointcut rpc) { Assert.IsFalse(rpc.Matches(typeof(object).GetMethod("GetHashCode"), typeof(int))); Assert.IsFalse(rpc.Matches(typeof(object).GetMethod("GetType"), typeof(Type))); Assert.AreEqual(0, rpc.Patterns.Length); }
protected void ExactMatchWithGenericTypeTests(AbstractRegularExpressionMethodPointcut rpc) { // assumes rpc.setPattern("System.Collections.Generic.List<string>"); Assert.IsTrue(rpc.Matches(typeof(System.Collections.Generic.List<string>).GetMethod("Add"), typeof(int))); Assert.IsFalse(rpc.Matches(typeof(System.Collections.Generic.List<string>).GetMethod("GetType"), typeof(Type))); }
protected void ExactMatchTests(AbstractRegularExpressionMethodPointcut rpc) { // assumes rpc.setPattern("java.lang.Object.hashCode"); Assert.IsTrue(rpc.Matches(typeof(object).GetMethod("GetHashCode"), typeof(int))); Assert.IsFalse(rpc.Matches(typeof(object).GetMethod("GetType"), typeof(Type))); }
public void WildcardWithGenericType() { pointcut.Pattern = ".*List<string>.Add"; Assert.IsTrue(pointcut.Matches(typeof(System.Collections.Generic.List <string>).GetMethod("Add"), typeof(int))); Assert.IsFalse(pointcut.Matches(typeof(System.Collections.Generic.List <string>).GetMethod("GetType"), typeof(Type))); }
protected void ExactMatchWithGenericTypeTests(AbstractRegularExpressionMethodPointcut rpc) { // assumes rpc.setPattern("System.Collections.Generic.List<string>"); Assert.IsTrue(rpc.Matches(typeof(System.Collections.Generic.List <string>).GetMethod("Add"), typeof(int))); Assert.IsFalse(rpc.Matches(typeof(System.Collections.Generic.List <string>).GetMethod("GetType"), typeof(Type))); }