/// <summary> /// Initializes a new instance of the <see cref="ParameterizedMethodSuite"/> class. /// </summary> public ParameterizedMethodSuite(IMethodInfo method) : base(method.TypeInfo.FullName, method.Name) { Method = method; _isTheory = method.IsDefined <TheoryAttribute>(true); this.MaintainTestOrder = true; }
/// <summary> /// Construct from a MethodInfo /// </summary> /// <param name="method"></param> public ParameterizedMethodSuite(IMethodInfo method) : base(method.TypeInfo.FullName, method.Name) { Method = method; #if PORTABLE _isTheory = false; #else _isTheory = method.IsDefined<TheoryAttribute>(true); #endif this.MaintainTestOrder = true; }
/// <summary> /// Construct from a MethodInfo /// </summary> /// <param name="method"></param> public ParameterizedMethodSuite(IMethodInfo method) : base(method.TypeInfo.FullName, method.Name) { Method = method; #if PORTABLE _isTheory = false; #else _isTheory = method.IsDefined <TheoryAttribute>(true); #endif this.MaintainTestOrder = true; }
/// <summary> /// Determines if the method can be used to build an NUnit test /// test method of some kind. The method must normally be marked /// with an identifying attribute for this to be true. /// /// Note that this method does not check that the signature /// of the method for validity. If we did that here, any /// test methods with invalid signatures would be passed /// over in silence in the test run. Since we want such /// methods to be reported, the check for validity is made /// in BuildFrom rather than here. /// </summary> /// <param name="method">An IMethodInfo for the method being used as a test method</param> /// <returns>True if the builder can create a test case from this method</returns> public bool CanBuildFrom(IMethodInfo method) { return(method.IsDefined <ITestBuilder>(false) || method.IsDefined <ISimpleTestBuilder>(false)); }
public bool IsDefined <T>(bool inherit) where T : class { return(_baseInfo.IsDefined <T>(inherit)); }
/// <summary> /// Determines if the method can be used to build an NUnit test /// test method of some kind. The method must normally be marked /// with an identifying attribute for this to be true. /// /// Note that this method does not check that the signature /// of the method for validity. If we did that here, any /// test methods with invalid signatures would be passed /// over in silence in the test run. Since we want such /// methods to be reported, the check for validity is made /// in BuildFrom rather than here. /// </summary> /// <param name="method">An IMethodInfo for the method being used as a test method</param> /// <returns>True if the builder can create a test case from this method</returns> public bool CanBuildFrom(IMethodInfo method) { return method.IsDefined<ITestBuilder>(false) || method.IsDefined<ISimpleTestBuilder>(false); }