private void GenerateTestCasePlanListMenu_Click(object sender, EventArgs e) { //TestPlanList.Items.Clear(); TestPlanListView.Clear(); selectedTestCasesList.Clear(); testCaseIndex = 0; int runCounter = 0; foreach (string testCase in GetAllCheckedNodes()) { runCounter++; //TestPlanList.Items.Add("[" + runCounter + "] " + testCase); GenerateTestCasePlanListView(runCounter, testCase); selectedTestCasesList.Add(testCase); } RunTestCase.Text = "|测试运行数:" + runCounter; testPlan.SelectTab("TestCaseListTab"); }
private void GenerateTestCasePlanListView(int count, string testCase) { TestPlanListView.SmallImageList = icoList; //创建列 if (count == 1) { TestPlanListView.Clear(); this.TestPlanListView.Columns.Add("", 30, HorizontalAlignment.Center); this.TestPlanListView.Columns.Add("ID", 50, HorizontalAlignment.Center); this.TestPlanListView.Columns.Add("Test Case", 350, HorizontalAlignment.Left); } TestPlanListView.BeginUpdate(); ListViewItem lvi = new ListViewItem(); lvi.ImageIndex = 0; lvi.SubItems.Add("[" + count.ToString() + "]"); lvi.SubItems.Add(testCase); TestPlanListView.Items.Add(lvi); TestPlanListView.EndUpdate(); }
private void GenerateAgainToolStripMenuItem_Click(object sender, EventArgs e) { if (TestPlanListView.SelectedItems.Count == 0) { return; } //清除已经有的测试用例列表 selectedTestCasesList.Clear(); foreach (ListViewItem item in TestPlanListView.SelectedItems) { selectedTestCasesList.Add(item.SubItems[2].Text); } TestPlanListView.Clear(); testCaseIndex = 0; int runCounter = 0; foreach (string testCase in selectedTestCasesList) { runCounter++; GenerateTestCasePlanListView(runCounter, testCase); } RunTestCase.Text = "|测试运行数:" + runCounter; }