The arguments provided when raising a report result event.
상속: System.EventArgs
예제 #1
0
        void TestClient_ReportTestProgress(object sender, ServerTestClient.ReportProgressEventArgs e)
        {
            if (InvokeRequired)
            {
                this.Invoke(new EventHandler <ServerTestClient.ReportProgressEventArgs>(TestClient_ReportTestProgress), sender, e);
                return;
            }

            try
            {
                if (this.Test_NoDisplayUpdateMI.Checked)
                {
                    return;
                }

                e.Stop = !m_running;

                if (!m_running)
                {
                    return;
                }

                TestsCompletedTB.Text = Utils.Format(
                    "{0} ({1} Failed)",
                    e.TestCount,
                    e.FailedTestCount);

                EndpointTB.Text = Utils.Format(
                    "{0} of {1} [{2}:{3}:{4}:{5}]",
                    e.EndpointCount,
                    e.TotalEndpointCount,
                    e.Endpoint.EndpointUrl.Scheme,
                    e.Endpoint.Description.SecurityMode,
                    SecurityPolicies.GetDisplayName(e.Endpoint.Description.SecurityPolicyUri),
                    (e.Endpoint.Configuration.UseBinaryEncoding)?"Binary":"XML");

                IterationTB.Text = Utils.Format(
                    "{0} of {1}",
                    e.IterationCount,
                    e.TotalIterationCount);

                TestCaseTB.Text = Utils.Format("{0}/{1}", e.Testcase.Parent, e.Testcase.Name);

                if (e.Breakpoint)
                {
                    DialogResult result = MessageBox.Show(
                        "Stopped at breakpoint. Continue?",
                        e.Testcase.Name,
                        MessageBoxButtons.OKCancel,
                        MessageBoxIcon.Question,
                        MessageBoxDefaultButton.Button1);

                    e.Stop = result != DialogResult.OK;
                    return;
                }

                double progress = (e.CurrentProgress / e.FinalProgress) * (TestCaseProgressCTRL.Maximum - TestCaseProgressCTRL.Minimum);

                if (progress < TestCaseProgressCTRL.Minimum)
                {
                    progress = TestCaseProgressCTRL.Minimum;
                }

                if (progress > TestCaseProgressCTRL.Maximum)
                {
                    progress = TestCaseProgressCTRL.Maximum;
                }

                TestCaseProgressCTRL.Value = (int)progress;
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }