public UnitTestCollection GetFailedTests(DateTime date)
        {
            UnitTestCollection col = new UnitTestCollection();

            CollectFailedTests(col, date);
            return(col);
        }
        public UnitTestCollection GetRegressions(DateTime fromDate, DateTime toDate)
        {
            UnitTestCollection list = new UnitTestCollection();

            FindRegressions(list, fromDate, toDate);
            return(list);
        }
 internal override void FindRegressions(UnitTestCollection list, DateTime fromDate, DateTime toDate)
 {
     foreach (UnitTest test in Tests)
     {
         test.FindRegressions(list, fromDate, toDate);
     }
 }
        internal virtual void FindRegressions(UnitTestCollection list, DateTime fromDate, DateTime toDate)
        {
            UnitTestResult res1 = Results.GetLastResult(fromDate);
            UnitTestResult res2 = Results.GetLastResult(toDate);

            if ((res1 == null || res1.IsSuccess) && (res2 != null && !res2.IsSuccess))
            {
                list.Add(this);
            }
        }
		void CollectFailedTests (UnitTestCollection col, DateTime date)
		{
			foreach (UnitTest t in Tests) {
				if (t is UnitTestGroup)
					((UnitTestGroup)t).CollectFailedTests (col, date);
				else {
					UnitTestResult res = t.Results.GetLastResult (date);
					if (res != null && res.IsFailure)
						col.Add (t);
				}
			}
		}
 public void UpdateTests()
 {
     if (tests != null)
     {
         foreach (UnitTest t in tests)
         {
             t.Dispose();
         }
         tests = null;
         OnTestChanged();
     }
 }
 void CollectFailedTests(UnitTestCollection col, DateTime date)
 {
     foreach (UnitTest t in Tests)
     {
         if (t is UnitTestGroup)
         {
             ((UnitTestGroup)t).CollectFailedTests(col, date);
         }
         else
         {
             UnitTestResult res = t.Results.GetLastResult(date);
             if (res != null && res.IsFailure)
             {
                 col.Add(t);
             }
         }
     }
 }
		public void UpdateTests ()
		{
			if (tests != null) {
				foreach (UnitTest t in tests)
					t.Dispose ();
				tests = null;
				OnTestChanged ();
			}
		}
		public UnitTestCollection GetFailedTests (DateTime date)
		{
			UnitTestCollection col = new UnitTestCollection ();
			CollectFailedTests (col, date);
			return col;
		}
		internal override void FindRegressions (UnitTestCollection list, DateTime fromDate, DateTime toDate)
		{
			foreach (UnitTest test in Tests)
				test.FindRegressions (list, fromDate, toDate);
		}
Exemple #11
0
        void FillTestInformation()
        {
            if (!detailsPad.Visible)
            {
                return;
            }

            if (detailsTest is UnitTestGroup)
            {
                UnitTestGroup group = detailsTest as UnitTestGroup;
                if (infoBook.Page == TestSummaryPage)
                {
                    detailsStore.Clear();
                    foreach (UnitTest t in group.Tests)
                    {
                        UnitTestResult res = t.Results.GetLastResult(chart.CurrentDate);
                        if (res != null)
                        {
                            detailsStore.AppendValues(t, t.Name, res.Passed.ToString(), res.ErrorsAndFailures.ToString(), res.Ignored.ToString());
                        }
                        else
                        {
                            detailsStore.AppendValues(t, t.Name, "", "", "");
                        }
                    }
                }
                else if (infoBook.Page == TestRegressionsPage)
                {
                    regressionStore.Clear();
                    UnitTestCollection regs = detailsTest.GetRegressions(chart.ReferenceDate, chart.CurrentDate);
                    if (regs.Count > 0)
                    {
                        foreach (UnitTest t in regs)
                        {
                            regressionStore.AppendValues(t, t.Name, TestStatusIcon.Failure);
                        }
                    }
                    else
                    {
                        regressionStore.AppendValues(null, GettextCatalog.GetString("No regressions found."));
                    }
                }
                else if (infoBook.Page == TestFailuresPage)
                {
                    failedStore.Clear();
                    UnitTestCollection regs = group.GetFailedTests(chart.CurrentDate);
                    if (regs.Count > 0)
                    {
                        foreach (UnitTest t in regs)
                        {
                            failedStore.AppendValues(t, t.Name, TestStatusIcon.Failure);
                        }
                    }
                    else
                    {
                        failedStore.AppendValues(null, GettextCatalog.GetString("No failed tests found."));
                    }
                }
            }
            else
            {
                UnitTestResult res = detailsTest.Results.GetLastResult(chart.CurrentDate);
                if (infoBook.Page == TestOutputPage)
                {
                    outputView.Buffer.Clear();
                    if (res != null)
                    {
                        outputView.Buffer.InsertAtCursor(res.ConsoleOutput);
                    }
                }
                else if (infoBook.Page == TestResultPage)
                {
                    resultView.Buffer.Clear();
                    if (res != null)
                    {
                        string msg = res.Message + "\n\n" + res.StackTrace;
                        resultView.Buffer.InsertAtCursor(msg);
                    }
                }
            }
        }
		internal virtual void FindRegressions (UnitTestCollection list, DateTime fromDate, DateTime toDate)
		{
			UnitTestResult res1 = Results.GetLastResult (fromDate);
			UnitTestResult res2 = Results.GetLastResult (toDate);
			if ((res1 == null || res1.IsSuccess) && (res2 != null && !res2.IsSuccess))
				list.Add (this);
		}
		public UnitTestCollection GetRegressions (DateTime fromDate, DateTime toDate)
		{
			UnitTestCollection list = new UnitTestCollection ();
			FindRegressions (list, fromDate, toDate);
			return list;
		}