Beispiel #1
0
        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");
            }
        }
Beispiel #2
0
        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");
            }
        }