private IsContextSpecification ( |
||
classTypeToInvestigate | ||
return | bool |
/// <summary> /// Checks whether the type is a candidate for the aspect to apply to it. /// </summary> /// <param name="type">the type to check if it needs the attribute.</param> /// <returns><c>true</c> if any of the <see cref="instanceLevelRules"/> attribute needs to be applied to the type; <c>false</c> otherwise.</returns> public override bool CompileTimeValidate(Type type) { if (!TypeInvestigationService.IsContextSpecification(type)) { return(false); } var validates = false; // ReSharper disable once LoopCanBeConvertedToQuery foreach (var rule in this.instanceLevelRules) { // do not break as some validators raise errors. validates = validates | rule.CompileTimeValidate(type); } return(validates); }
/// <summary> /// Checks if the passed class contains any nested test fixture classes. /// </summary> /// <param name="type"> /// The type of the class to check. /// </param> /// <returns> /// <c>true</c> if the passed class contains any any nested test fixture classes, <c>false</c> otherwise. /// </returns> public override bool CompileTimeValidate(Type type) { // Use reflection to find <see cref="TestFixtureAttribute"/>, instead of binding to the NUnit type directly. // This prevents versioning issues with PostSharp when applying the aspect at compile-time. return(TypeInvestigationService.IsContextSpecification(type) && base.CompileTimeValidate(type)); }