Ejemplo n.º 1
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (openTestCaseFileDialog.ShowDialog() == DialogResult.OK)
     {
         try
         {
             m_testCaseSet = new TestCaseSet(openTestCaseFileDialog.FileName);
             List <TestCase> testCaseList = m_testCaseSet.TestCaseList;
             UpdateDataGridViewTestCases(testCaseList);
         }
         catch (Exception)
         {
             MessageBox.Show("Bad test case file format.");
         }
     }
 }
Ejemplo n.º 2
0
        private void RunAllTestCases(TestCaseSet testCaseSet, bool onlyRunSelected, bool baseline)
        {
            if (!CheckAllCommandFileExist())
            {
                return;
            }

            List <TestCase> testCaseList = testCaseSet.TestCaseList;

            //FileInfo file = new FileInfo(testCaseSet.TestCaseFilePath);
            //DirectoryInfo outputDir = new DirectoryInfo(
            //    Path.Combine(file.DirectoryName, OutputDirectory));
            //if (!outputDir.Exists)
            //    outputDir.Create();
            if (m_runTestCaseThread != null && m_runTestCaseThread.IsAlive)
            {
                MessageBox.Show("Stop running test case first.");
                return;
            }
            m_runTestCaseThread = new Thread(delegate() {
                this.Invoke(m_enableRunMenuItemDelegate, new object[] { false });
                try
                {
                    for (int i = 0; i < testCaseList.Count; i++)
                    {
                        if (!onlyRunSelected ||
                            dataGridViewTestCases.Rows[i].Cells[0].EditedFormattedValue.ToString() == "True")
                        {
                            TestCaseRunner runner = new TestCaseRunner(testCaseList[i], m_settings, i + 1);
                            runner.Run(baseline);
                        }
                    }
                }
                catch (ThreadAbortException)
                {
                }
                finally
                {
                    ChangeRunningTestCases2Untested(testCaseList);
                    this.Invoke(m_enableRunMenuItemDelegate, new object[] { true });
                }
            });
            m_runTestCaseThread.IsBackground = true;
            m_runTestCaseThread.Start();
        }
Ejemplo n.º 3
0
 private void RunSelectedTestCases(TestCaseSet testCaseSet)
 {
     RunAllTestCases(testCaseSet, onlyRunSelected: true, baseline: false);
 }
Ejemplo n.º 4
0
 private void RunSelectedTestCases(TestCaseSet testCaseSet)
 {
     RunAllTestCases(testCaseSet, true);
 }
Ejemplo n.º 5
0
        private void RunAllTestCases(TestCaseSet testCaseSet, bool onlyRunSelected)
        {
            if (!CheckAllCommandFileExist())
                return;

            List<TestCase> testCaseList = testCaseSet.TestCaseList;
            //FileInfo file = new FileInfo(testCaseSet.TestCaseFilePath);
            //DirectoryInfo outputDir = new DirectoryInfo(
            //    Path.Combine(file.DirectoryName, OutputDirectory));
            //if (!outputDir.Exists)
            //    outputDir.Create();
            if (m_runTestCaseThread != null && m_runTestCaseThread.IsAlive)
            {
                MessageBox.Show("Stop running test case first.");
                return;
            }
            m_runTestCaseThread = new Thread(delegate() {
                this.Invoke(m_enableRunMenuItemDelegate, new object[] { false });
                try
                {
                    for (int i = 0; i < testCaseList.Count; i++)
                    {
                        if (!onlyRunSelected ||
                            dataGridViewTestCases.Rows[i].Cells[0].EditedFormattedValue.ToString() == "True")
                        {
                            TestCaseRunner runner = new TestCaseRunner(testCaseList[i],
                                m_settings, i+1);
                            runner.Run();
                        }
                    }
                }
                catch (ThreadAbortException)
                {
                }
                finally
                {
                    ChangeRunningTestCases2Untested(testCaseList);
                    this.Invoke(m_enableRunMenuItemDelegate, new object[] { true });
                }
            });
            m_runTestCaseThread.IsBackground = true;
            m_runTestCaseThread.Start();
        }
Ejemplo n.º 6
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (openTestCaseFileDialog.ShowDialog() == DialogResult.OK)
     {
         try
         {
             m_testCaseSet = new TestCaseSet(openTestCaseFileDialog.FileName);
             List<TestCase> testCaseList = m_testCaseSet.TestCaseList;
             UpdateDataGridViewTestCases(testCaseList);
         }
         catch (Exception)
         {
             MessageBox.Show("Bad test case file format.");
         }
     }
 }