public override int RunTestSuite(Dictionary<string, string> argDic, BackgroundRunner bw) { bool testResult = false; this.log = ""; System.IO.TextWriter standardWr = System.Console.Out; System.IO.StringWriter strWr = new System.IO.StringWriter(); System.Console.SetOut(strWr); try { TestCaller caller = new TestCaller(bw); testResult = caller.RunTest(this, argDic, strWr); } catch (Exception ex) { this.log += ex.ToString(); this.htmlOutput = "<html><body>"; this.htmlOutput += ex.Message; this.htmlOutput += "</body></html>"; } strWr.Close(); System.Console.SetOut(standardWr); int testColor = NodeColors.Passed; if (!testResult) { testColor = NodeColors.Failed; } bw.ReportProgress(testColor, this); return testColor; }
public virtual int RunTestSuite(Dictionary<string, string> argDic, BackgroundRunner bw) { int nodeColor = NodeColors.Passed; foreach (RootNode childNode in this.Nodes) { int childColor = childNode.RunTestSuite(argDic, bw); if (childColor != NodeColors.Passed) { nodeColor = childColor; } if (bw.CancellationPending) { if (Nodes.IndexOf(childNode) == Nodes.Count - 1) { bw.ReportProgress(nodeColor, this); return nodeColor; } return NodeColors.Default; } } bw.ReportProgress(nodeColor, this); return nodeColor; }