/// <summary> /// Is there a runtime (dynamic) match for the supplied /// <paramref name="method"/>? /// </summary> /// <remarks> /// <p> /// Subclasses are encouraged to override this method if it is possible /// to filter out some candidate classes. /// </p> /// </remarks> /// <param name="method">The candidate method.</param> /// <param name="targetType">The target class.</param> /// <param name="args">The arguments to the method</param> /// <returns> /// <see langword="true"/> if there is a runtime match.</returns> /// <seealso cref="Spring.Aop.IMethodMatcher.Matches(MethodInfo, Type, object[])"/> public virtual bool Matches(MethodInfo method, Type targetType, object[] args) { ++_evaluationCount; IControlFlow cflow = ControlFlowFactory.CreateControlFlow(); return((_methodName != null) ? cflow.Under(_type, _methodName) : cflow.Under(_type)); }
public void DefaultCflowIsNotUnderSomeArbitraryClass() { IControlFlow cflow = ControlFlowFactory.CreateControlFlow(); bool isUnder = cflow.Under(typeof(TestObject)); Assert.IsFalse(isUnder, string.Format( "The IControlFlow implementation created by the ControlFlowFactory factory class " + "would appear to have a faulty Under(Type) implementation : [{0}]", cflow.GetType())); }
public void DefaultCflowUnderThisTest() { IControlFlow cflow = ControlFlowFactory.CreateControlFlow(); bool isUnder = cflow.Under(GetType()); Assert.IsTrue(isUnder, string.Format( "The IControlFlow implementation created by the ControlFlowFactory factory class " + "would appear to have a faulty Under(Type) implementation : [{0}]", cflow.GetType())); }
public void DefaultCflowIsNotUnderThisTestAndSomeRandomMethodName() { IControlFlow cflow = ControlFlowFactory.CreateControlFlow(); bool isUnder = cflow.Under(GetType(), "PlayingYouALikeTheFoolYouAre"); Assert.IsFalse(isUnder, string.Format( "The IControlFlow implementation created by the ControlFlowFactory factory class " + "would appear to have a faulty Under(Type,string) implementation : [{0}]", cflow.GetType())); }