private void runTestsToolStripMenuItem_Click(object sender, EventArgs eventArgs) { FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { folderBrowserDialog.Dispose(); string path = Path.Combine(folderBrowserDialog.SelectedPath, "EditSF_test.txt"); FileTester fileTester = new FileTester(); using (TextWriter textWriter = File.CreateText(path)) { foreach (string item in Directory.EnumerateFiles(folderBrowserDialog.SelectedPath)) { if (!item.EndsWith("EditSF_test.txt")) { string value = fileTester.RunTest(item, _progressBar, _statusLabel); textWriter.WriteLine(value); textWriter.Flush(); } } } MessageBox.Show($"Test successes {fileTester.TestSuccesses}/{fileTester.TestsRun}", "Tests finished"); } }
private void runTestsToolStripMenuItem_Click(object sender, EventArgs eventArgs) { FolderBrowserDialog dialog = new FolderBrowserDialog(); if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { dialog.Dispose(); string logFileName = Path.Combine(dialog.SelectedPath, "EditSF_test.txt"); FileTester tester = new FileTester(); using (TextWriter logWriter = File.CreateText(logFileName)) { foreach (string file in Directory.EnumerateFiles(dialog.SelectedPath)) { if (file.EndsWith("EditSF_test.txt")) { continue; } string testResult = tester.RunTest(file, progressBar, statusLabel); logWriter.WriteLine(testResult); logWriter.Flush(); } } MessageBox.Show(string.Format("Test successes {0}/{1}", tester.TestSuccesses, tester.TestsRun), "Tests finished"); } }
private void runSingleTestToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog openDialog = new OpenFileDialog { RestoreDirectory = true }; if (openDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string output = new FileTester().RunTest(openDialog.FileName, progressBar, statusLabel); MessageBox.Show(output, "Test Finished"); } }
private void runSingleTestToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.RestoreDirectory = true; OpenFileDialog openFileDialog2 = openFileDialog; if (openFileDialog2.ShowDialog() == DialogResult.OK) { string text = new FileTester().RunTest(openFileDialog2.FileName, _progressBar, _statusLabel); MessageBox.Show(text, "Test Finished"); } }