Esempio n. 1
0
 public void AddDetails(XmlDocument testDoc,
                 XmlDocument resultDoc,
                 XmlDocument htmlResultDoc,
                 Dictionary<string, string> argsDic,
                 TestFinishedDelegate testFinishedCallback,
                 BackgroundRunner bgWorker)
 {
     testDocument = testDoc;
     resultDocument = resultDoc;
     htmlResultDocument = htmlResultDoc;
     testFile = argsDic["testfile"];
     testFinished = testFinishedCallback;
     bgRunner = bgWorker;
     sfRunDetails = new RunnerDetails(argsDic);
 }
Esempio n. 2
0
 public TestCaller(BackgroundRunner bw)
 {
     bgRunner = bw;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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;
 }