Ejemplo n.º 1
0
        public frmTestCase(int id_url, string url, bool isnew)
        {
            InitializeComponent();
            this.isNew     = isnew;
            this.Id_URL    = id_url;
            this.URL       = url;
            lbid_url.Text  = Id_URL.ToString();
            txtboxUrl.Text = URL;
            //Place the Header CheckBox in the Location of the Header Cell.
            headerCheckBox.Location  = new Point(60, 5);
            headerCheckBox.BackColor = Color.White;
            headerCheckBox.Size      = new Size(13, 13);
            headerCheckBox.Checked   = true;
            //Assign Click event to the Header CheckBox.
            headerCheckBox.Click += new EventHandler(HeaderCheckBox_Clicked);
            dataGridViewListTestCase.Controls.Add(headerCheckBox);
            try
            {
                ListTestCase = new List <Test_case>();

                if (isNew == true)
                {
                    NewListTestCase = new TestCase.TestCase(Id_URL);
                    ListTestCase    = NewListTestCase.Generate_testcase();//generate test case
                    GetNumberOfResult();
                }
                else
                {
                    ListTestCase = BUL.TestCaseBUL.Get_ListTestcase(Id_URL);//load testcase
                    GetNumberOfResult();
                }
                dataGridViewListTestCase.DataSource = ListTestCase;

                CountTestcaseTest       = NumberOfTestcase = ListTestCase.Count;
                lbNumberOfTestcase.Text = NumberOfTestcase.ToString();
                lbCurrentCount.Text     = CountTestcaseTest.ToString();
            }
            catch
            {
                if (isNew == true)
                {
                    MessageBox.Show("Error when generate test case", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Error when load test case", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            //Save_testcase();
        }
Ejemplo n.º 2
0
 public void SetUp()
 {
     _testCase = new TestCase.TestCase();
 }