private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (rbComparisonMode.Checked) { Invoke((MethodInvoker) delegate { lbInfo.Items.Insert(0, "Completed !"); if (TestedCount > 0) { lbInfo.Items.Insert(0, "SỐ TEST GẶP LỖI: " + ErrorCount); lbInfo.Items.Insert(0, "SỐ TEST SAI: " + FailedCount); lbInfo.Items.Insert(0, "SỐ TEST ĐÚNG: " + PassedCount); lbInfo.Items.Insert(0, "SỐ TEST CHƯA CHẠY: " + NotTestedCount); lbInfo.Items.Insert(0, "SỐ TEST ĐÃ CHẠY : " + TestedCount); lbInfo.Items.Insert(0, "TỔNG SỐ TEST : " + TotalTestCount); } }); if (TestedCount > 0) { if (PassedCount == TotalTestCount) { MessageBox.Show("Passed all the test !"); } DialogResult dialogResult = MessageBox.Show("Click to see the results in detail."); if (dialogResult == DialogResult.OK) { ListResults listResults = new ListResults(PassedTests, FailedTests, ErrorTests); listResults.ShowDialog(); } } } else { Invoke((MethodInvoker) delegate { lbInfo.Items.Insert(0, "Completed !"); if (TestedCount > 0) { lbInfo.Items.Insert(0, "SỐ TEST GẶP LỖI: " + ErrorCount); lbInfo.Items.Insert(0, "SỐ TEST CHƯA CHẠY: " + NotTestedCount); lbInfo.Items.Insert(0, "SỐ TEST ĐÃ CHẠY : " + TestedCount); lbInfo.Items.Insert(0, "TỔNG SỐ TEST : " + TotalTestCount); } }); if (TestedCount > 0) { MessageBox.Show("Click to see your outputs !"); Explorer.OpenFolder(SystemFolder.GetOutDir()); } } EnableBtn(); }
private void btnResults_Click(object sender, EventArgs e) { ListResults listResults = new ListResults(PassedTests, FailedTests, ErrorTests); listResults.ShowDialog(); }