protected override UnitTestResult OnRun(TestContext testContext)
        {
            UnitTestResult tres = new UnitTestResult();

            OnBeginTest(testContext);

            try {
                foreach (UnitTest t in Tests)
                {
                    if (t.IsExplicit)
                    {
                        continue;
                    }
                    UnitTestResult res;
                    try {
                        res = OnRunChildTest(t, testContext);
                        if (testContext.Monitor.CancellationToken.IsCancellationRequested)
                        {
                            break;
                        }
                    } catch (Exception ex) {
                        res = UnitTestResult.CreateFailure(ex);
                    }
                    tres.Add(res);
                }
            } finally {
                OnEndTest(testContext);
            }
            return(tres);
        }
        void ITestProgressMonitor.EndTest(UnitTest test, UnitTestResult result)
        {
            if (test is UnitTestGroup)
            {
                return;
            }

            testsRun++;
            ResultRecord rec = new ResultRecord();

            rec.Test   = test;
            rec.Result = result;

            resultSummary.Add(result);
            results.Add(rec);

            ShowTestResult(test, result);

            UpdateCounters();

            double frac;

            if (testsToRun != 0)
            {
                frac = ((double)testsRun / (double)testsToRun);
            }
            else
            {
                frac = 1;
            }

            frac = Math.Min(1, Math.Max(0, frac));

            progressBar.Fraction = frac;
            progressBar.Text     = testsRun + " / " + testsToRun;
        }
		protected override UnitTestResult OnRun (TestContext testContext)
		{
			UnitTestResult tres = new UnitTestResult ();
			OnBeginTest (testContext);
			
			try {
				foreach (UnitTest t in Tests) {
					if (t.IsExplicit)
						continue;
					UnitTestResult res;
					try {
						res = OnRunChildTest (t, testContext);
						if (testContext.Monitor.CancellationToken.IsCancellationRequested)
							break;
					} catch (Exception ex) {
						res = UnitTestResult.CreateFailure (ex);
					}
					tres.Add (res);
				}
			} finally {
				OnEndTest (testContext);
			}
			return tres;
		}