コード例 #1
0
 private void loadTRun()
 {
     if (!string.IsNullOrEmpty(txtAutomationFileName.Text))
     {
         TRun = AutomationHelper.TestRun.LoadFromFile(txtAutomationFileName.Text);
         automationHelper_MethodBindingSource.DataSource = TRun.Methods;
         cbHTTP_HTTPS.Text = TRun.GetSecure().HasValue&& TRun.GetSecure().Value ? "https" : "http";
     }
 }
コード例 #2
0
        private void btnRunSelected_Click(object sender, EventArgs e)
        {
            var testRun = AutomationHelper.TestRun.LoadFromFile(txtAutomationFileName.Text);

            if (testRun == null)
            {
                return;
            }

            tabTestRun.SelectedIndex = 1;

            automationHelper_MethodBindingSource.ResetBindings(true);
            automationHelper_MethodBindingSource.ResumeBinding();
            var methods = automationHelper_MethodBindingSource.DataSource as List <AutomationHelper.Method>;

            if (TRun != null)
            {
                foreach (var method in methods)
                {
                    var fMethod = testRun.Methods.Where(m => m.TestName.Equals(method.TestName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
                    if (fMethod != null)
                    {
                        fMethod.Include = method.Include;
                    }
                }

                TRun = testRun;
            }

            testRun.RunAll = false;

            btnRunAll.Enabled      = false;
            btnRunSelected.Enabled = false;
            var secure = cbHTTP_HTTPS.Text.Equals("https", StringComparison.InvariantCultureIgnoreCase);

            testRun.Run(secure, res => {
                resultsBindingSource.DataSource = res.Results;
                resultsBindingSource.ResetBindings(true);
                resultsBindingSource.ResumeBinding();
                paintDataGridRows();
            },
                        (res) => {
                this.LastResult        = res;
                btnRunAll.Enabled      = true;
                btnRunSelected.Enabled = true;
            });
        }