Ejemplo n.º 1
0
        protected void ProtocolTestRun_TestSuccess(ProtocolTestRun sender, ProtocolUnitTestEventArgs e)
        {
            if (this.InvokeRequired == true) {
                this.Invoke(new Action<ProtocolTestRun, ProtocolUnitTestEventArgs>(this.ProtocolTestRun_TestSuccess), sender, e);
                return;
            }

            this.OutputTestResult(e.Test);

            this.ConsoleAppendLine("END: [^2SUCCESS^0]");
        }
Ejemplo n.º 2
0
        protected void LoadProtocolTest()
        {
            this.rtbProtocolTestOutput.Text = String.Empty;

            // Dispose of the old object, we're just about to replace it.
            if (this.ProtocolTestRun != null) {
                this.ProtocolTestRun.Dispose();
            }

            try {
                XDocument document = XDocument.Load(this.txtProtocolTestFile.Text);

                this.ProtocolTestRun = document.Root.FromXElement<ProtocolTestRun>();

                this.ProtocolTestRun.ConnecionIsolation = this.chkConnectionIsolation.Checked;

                String selectedTestText = String.IsNullOrEmpty(this.cboTests.Text) == true ? "All" : this.cboTests.Text;

                this.cboTests.Items.Clear();
                this.cboTests.Items.Add("All");

                for (int offset = 0; offset < this.ProtocolTestRun.Tests.Count; offset++) {
                    this.ProtocolTestRun.Tests[offset].Name = String.Format("{0} - {1}", offset.ToString("D4"), this.ProtocolTestRun.Tests[offset].Name);

                    this.cboTests.Items.Add(this.ProtocolTestRun.Tests[offset]);
                }

                // Reselect whatever test was selected.
                this.cboTests.Text = selectedTestText;

                this.OutputLoadedTest();

                this.btnRun.Enabled = true;
                this.btnReload.Enabled = true;
            }
            catch (Exception e) {
                this.rtbProtocolTestOutput.AppendText(e.Message);

                this.btnReload.Enabled = false;
            }
        }
Ejemplo n.º 3
0
        protected void ProtocolTestRun_TestBegin(ProtocolTestRun sender, ProtocolUnitTestEventArgs e)
        {
            if (this.InvokeRequired == true) {
                this.Invoke(new Action<ProtocolTestRun, ProtocolUnitTestEventArgs>(this.ProtocolTestRun_TestBegin), sender, e);
                return;
            }

            this.ConsoleAppendLine("===========================================================================================");
            this.ConsoleAppendLine("BEGIN: {0}", e.Test.Name);

            e.Test.TestEvent += new ProtocolUnitTest.TestEventHandler(Test_TestEvent);
            e.Test.TestSetup += new ProtocolUnitTest.TestEventHandler(Test_TestSetup);
        }