public static GetTestMethods ( |
||
type | /// The type to inspect. /// | |
flattenHierarchy | bool | /// Specifies that tests from parent fixtures should be returned. /// |
return | IEnumerable |
private static IEnumerable <MethodBase> SelectEmptyTestMethods(Type type) { var selectEmptyTestMethods = from testMethod in TypeInvestigationService.GetTestMethods(type, false) where !testMethod.IsAbstract && !TypeInvestigationService.IsExpectedExceptionTestMethod(testMethod) && GetIntermediateLanguageFromMethodInfoBase(testMethod).Count() <= 2 select testMethod; return(selectEmptyTestMethods); }
private static IEnumerable <MethodBase> SelectExceptionResilientTestMethods(Type type) { var testMethodsInContext = TypeInvestigationService.GetAllContextSpecificationTypes(type) .SelectMany(nestedType => TypeInvestigationService.GetTestMethods(nestedType, true)); var expectedExceptionTestMethodsInContext = TypeInvestigationService.GetTestMethods(type, true) .Concat(testMethodsInContext) .Where(TypeInvestigationService.IsExpectedExceptionTestMethod) .ToArray(); // If there is any test method marked with ExpectedExceptionAttribute, then all other act as if marked with ExceptionResilientAttribute if (expectedExceptionTestMethodsInContext.Any()) { var testMethods = TypeInvestigationService.GetTestMethods(type, false); return(testMethods.Except(expectedExceptionTestMethodsInContext).ToArray()); } return(Enumerable.Empty <MethodBase>()); }
private static IEnumerable <MethodBase> SelectTestMethods(Type type) { var testMethods = TypeInvestigationService.GetTestMethods(type, false); return(testMethods.Except(SelectExceptionResilientTestMethods(type))); }