/// <summary> /// Publish final results. If not yet ready, will keep waiting around /// as a work item until it is done. /// </summary> private void PublishFinalResults() { if (TestService != null && TestService.BusyServiceReferenceCounter > 0) { if (_harnessTasks == null) { _harnessTasks = new CompositeWorkItem(); } _harnessTasks.Enqueue(new CallbackWorkItem(() => { })); _harnessTasks.Enqueue(new CallbackWorkItem(PublishFinalResults)); if (RunDispatcher == null) { RunDispatcher = RunDispatcher.Create(RunNextStep, Dispatcher); RunDispatcher.Run(); } } else { _harnessTasks = null; RunDispatcher = null; PublishFinalResult(); if (IsReportingTestServiceConnected()) { SetOverallStatus("Reporting complete..."); } } }
/// <summary> /// Reflect through the class to find any test methods, and add them to /// the list of queued methods. Also, sorts the methods if appropriate /// based on the settings file. /// </summary> private void PopulateTestMethods() { List <ITestMethod> methods = _filter.GetTestMethods(_testClass, _instance); foreach (ITestMethod test in methods) { _testExecutionQueue.Enqueue(new TestMethodManager(TestHarness, _testClass, test, _instance, Provider)); } }
/// <summary> /// Reflect over all test classes in the assembly and add any which are not /// filtered out into the test work item queue. /// </summary> private void EnqueueTestClasses() { IList <ITestClass> classes = _filter.GetTestClasses(_assembly, ClassInstances); foreach (ITestClass testClass in classes) { _testClasses.Enqueue(TestHarness.LogicFactory.CreateTestClassManager(Provider, _filter, testClass, ClassInstances.GetInstance(testClass.Type))); } Enqueue(_testClasses); }