コード例 #1
0
        void K2TestHelper_SendTestResult(object sender, K2Field.Utilities.Testing.WF.Core.TestResultArgs e)
        {
            //now we have the results from the test, lets display them
            bool isDisplayed = false;

            if (e.ResultStage == TestResultStage.NewProcessTestStarting && !isDisplayed)
            {
                AddResult("\r");
                AddResult(e.ResultStage.ToString() + "  " + e.ExtraDetails);
                isDisplayed = true;
            }

            if (e.ResultStage == TestResultStage.ProcessStarted && !isDisplayed)
            {
                if (this.chkCreateViewFlowTabs.Checked)
                {
                    AddResult("\t" + e.ResultStage.ToString() + "  " + e.ExtraDetails);
                    Thread.Sleep(2000);
                    AddNewViewFlowTab(e.CurrentProcess.Description, e.CurrentProcess.ProcessInstanceID);
                }
                isDisplayed = true;
            }

            if (e.ResultStage == TestResultStage.CreateTask && !isDisplayed)
            {
                AddResult("\t" + e.ResultStage.ToString() + "  " + e.ExtraDetails);
                Thread.Sleep(2000);
                AddNewTaskTab();

                isDisplayed = true;
            }

            if (e.ResultStage == TestResultStage.ActivityActioned && !isDisplayed)
            {
                AddResult("\t" + e.ResultStage.ToString() + "  " + e.ExtraDetails);
                isDisplayed = true;
            }

            if (e.ResultStage.ToString().Contains("Activity") && !isDisplayed)
            {
                AddResult("\t" + e.ResultStage.ToString() + "  " + e.ExtraDetails);
                isDisplayed = true;
            }

            if (e.ResultStage == TestResultStage.TestEngineEnded && !isDisplayed)
            {
                this.statusStripTimer.Enabled = false;
                isDisplayed = true;
                ReportResults(K2TestHelper.GlobalProcesses);
            }

            if (e.ResultStage == TestResultStage.DebugMessage && chkDebug.Checked)
            {
                isDisplayed = false;
            }
            else if (e.ResultStage == TestResultStage.DebugMessage)
            {
                isDisplayed = true;
            }

            if (!isDisplayed)
            {
                AddResult(e.ResultStage.ToString() + "  " + e.ExtraDetails);
            }
        }
コード例 #2
0
 protected void SendResult(TestResultArgs e)
 {
     if (SendTestResult != null) SendTestResult(this, e);
 }