private void LoadTestsFromExamples() { _configurationTestSuite = new ConfigurationTestSuite(); IEnumerable<Type> testTypes = GetAllTestTypes(); foreach (Test test in testTypes.OrderBy(c => c.Name).Select(type => Activator.CreateInstance(type) as Test)) _configurationTestSuite.Tests.AddRange(test.CreateExamples()); }
private void LaunchNewTestEditor(ConfigurationTestSuite testSuite) { if (testSuite != null) { var editor = new TestEditor(testSuite) { MdiParent = this }; editor.Show(); } }
private static void CreateConfiguration(string file) { var temp = Console.ForegroundColor; try { if (File.Exists(file)) { Console.ForegroundColor = ConsoleColor.Red; WriteLine(OverwritePrompt, file); Console.ForegroundColor = ConsoleColor.White; var overwrite = Console.ReadKey(true); if (overwrite.Key != OverwriteAffirmativeKey) { WriteLine("Not overwriting."); return; } } Console.ForegroundColor = ConsoleColor.White; WriteLine("Preparing example data..."); var configurationInformation = new ConfigurationTestSuite(); configurationInformation.CreateExampleData(); string xmlString = configurationInformation.ToXmlString(); Console.Write("Writing file..."); File.WriteAllText(Path.Combine(".", file), xmlString, Encoding.Unicode); WriteLine(" Done."); } finally { Console.ForegroundColor = temp; } }
public TestEditor(ConfigurationTestSuite configurationTestSuite) : this() { _configurationTestSuite = configurationTestSuite; }
private void InitializeTestSuite() { _configurationTestSuite = new ConfigurationTestSuite { Name = txtTestName.Text, Description = string.Empty }; _configurationTestSuite.Tests.AddRange(lstListOfTests.Items.Cast<Test>()); }