void OnCombineRenamed(object sender, SolutionItemRenamedEventArgs e)
        {
            UnitTestGroup parent = Parent as UnitTestGroup;

            if (parent != null)
            {
                parent.UpdateTests();
            }
        }
Exemplo n.º 2
0
        public override void BuildChildNodes(ITreeBuilder builder, object dataObject)
        {
            UnitTestGroup test = dataObject as UnitTestGroup;

            if (test == null)
            {
                return;
            }

            foreach (UnitTest t in test.Tests)
            {
                builder.AddChild(t);
            }
        }
Exemplo n.º 3
0
            void ClearRunningStatus(UnitTest t)
            {
                t.Status = TestStatus.Ready;
                UnitTestGroup group = t as UnitTestGroup;

                if (group == null)
                {
                    return;
                }
                foreach (UnitTest ct in group.Tests)
                {
                    ClearRunningStatus(ct);
                }
            }
Exemplo n.º 4
0
        public string[] CollectTests(UnitTestGroup group)
        {
            List <string> result = new List <string> ();

            foreach (var t in group.Tests)
            {
                if (t is UnitTestGroup)
                {
                    result.AddRange(CollectTests((UnitTestGroup)t));
                }
                else
                {
                    result.Add(t.TestId);
                }
            }
            return(result.ToArray());
        }
Exemplo n.º 5
0
        public static void ResetResult(UnitTest test)
        {
            if (test == null)
            {
                return;
            }
            test.ResetLastResult();
            UnitTestGroup group = test as UnitTestGroup;

            if (group == null)
            {
                return;
            }
            foreach (UnitTest t in new List <UnitTest> (group.Tests))
            {
                ResetResult(t);
            }
        }
Exemplo n.º 6
0
 public UnitTest FindRootTest(IEnumerable <UnitTest> tests, IWorkspaceObject item)
 {
     foreach (UnitTest t in tests)
     {
         if (t.OwnerObject == item)
         {
             return(t);
         }
         UnitTestGroup tg = t as UnitTestGroup;
         if (tg != null)
         {
             UnitTest ct = FindRootTest(tg.Tests, item);
             if (ct != null)
             {
                 return(ct);
             }
         }
     }
     return(null);
 }
		public string[] CollectTests (UnitTestGroup group)
		{
			List<string> result = new List<string> ();
			foreach (var t in group.Tests) {
				if (t.IsExplicit)
					continue;
				if (t is UnitTestGroup) {
					result.AddRange (CollectTests ((UnitTestGroup)t));
				} else {
					result.Add (t.TestId);
				}
			}
			return result.ToArray ();
		}
Exemplo n.º 8
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);
                    }
                }
            }
        }
Exemplo n.º 9
0
        public override bool HasChildNodes(ITreeBuilder builder, object dataObject)
        {
            UnitTestGroup test = dataObject as UnitTestGroup;

            return(test != null && test.Tests.Count > 0);
        }