IList <ITestRunner> GetTestRunners(ITestCategory category) { var list = new List <ITestRunner> (); if (disabled) { return(list.AsReadOnly()); } foreach (var runner in Framework.GetTestRunners(this)) { if (!category.IsEnabled(runner)) { continue; } if (!HasCustomThreadingMode()) { list.Add(runner); continue; } if (HasDefaultThreadingMode()) { list.Add(new ThreadingModeProxyRunner(runner, ThreadingMode.Default)); } CheckThreadingModeProxy(list, runner, ThreadingMode.MainThread); CheckThreadingModeProxy(list, runner, ThreadingMode.ExitContext); CheckThreadingModeProxy(list, runner, ThreadingMode.ThreadPool); } return(list.AsReadOnly()); }
internal static bool Filter(TestCase test, ITestRunner runner, ITestCategory category) { if (!test.IsEnabled || !category.IsEnabled(test) || !runner.IsEnabled(test)) { return(false); } if (test.Categories.Where(c => !c.Equals(category)).Any(c => c.Explicit)) { return(false); } return(filters.Where(f => !f.Equals(category)).All(f => f.Filter(test))); }
IList<ITestRunner> GetTestRunners (ITestCategory category) { var list = new List<ITestRunner> (); if (disabled) return list.AsReadOnly (); foreach (var runner in Framework.GetTestRunners (this)) { if (!category.IsEnabled (runner)) continue; if (!HasCustomThreadingMode ()) { list.Add (runner); continue; } if (HasDefaultThreadingMode ()) list.Add (new ThreadingModeProxyRunner (runner, ThreadingMode.Default)); CheckThreadingModeProxy (list, runner, ThreadingMode.MainThread); CheckThreadingModeProxy (list, runner, ThreadingMode.ExitContext); CheckThreadingModeProxy (list, runner, ThreadingMode.ThreadPool); } return list.AsReadOnly (); }