private IEnumerable <NUnit.Framework.Internal.TestSuite> BuildFrom( NUnit.Framework.Interfaces.ITypeInfo typeInfo, Func <MethodInfo, bool> filter) { return (TestUtilities.ExtractTestCasesFromCoreTestTarget(). Select(byCategory => { var rootSuite = new NUnit.Framework.Internal.TestSuite(byCategory.Key); AddProperty(rootSuite.Properties, NUnit.Framework.Internal.PropertyNames.ParallelScope, this.ParallelScope); foreach (var byId in byCategory.Value) { var subSuite = new NUnit.Framework.Internal.TestSuite(byId.Key); AddProperty(subSuite.Properties, NUnit.Framework.Internal.PropertyNames.ParallelScope, this.ParallelScope); foreach (var testCase in byId.Value. Where(testCase => filter(testCase.Method))) { var test = this.BuildTestMethod( subSuite, testCase); AddProperty(test.Properties, NUnit.Framework.Internal.PropertyNames.ParallelScope, this.ParallelScope); subSuite.Add(test); } rootSuite.Add(subSuite); } return rootSuite; })); }
public IEnumerable <NUnit.Framework.Internal.TestSuite> BuildFrom( NUnit.Framework.Interfaces.ITypeInfo typeInfo, NUnit.Framework.Interfaces.IPreFilter filter) { return(this.BuildFrom(typeInfo, method => filter.IsMatch(method.DeclaringType, method))); }
public IEnumerable <NUnit.Framework.Internal.TestSuite> BuildFrom( NUnit.Framework.Interfaces.ITypeInfo typeInfo) { return(this.BuildFrom(typeInfo, _ => true)); }