private void btnSave_Click(object sender, EventArgs e) { if (ConversationList.IsEmpty) { return; } sFDDiagnosticsReport.FileName = String.Format("DiagnosticsReport_{0}.xml", DateTime.Now.ToShortTimeString().Replace(':', '_')); var result = sFDDiagnosticsReport.ShowDialog(); if (DialogResult.OK != result) { return; } String filename = sFDDiagnosticsReport.FileName; TestCaseSet.SaveTestsResult(filename); }
private TestCaseSet WriteTestFile(string name, string contents) { _pesterTestDir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString()); Directory.CreateDirectory(_pesterTestDir); _tempFile = Path.Combine(_pesterTestDir, "MyTests.Tests.ps1"); File.WriteAllText(_tempFile, contents); var testCase = new TestCase(name, new Uri("http://test.com"), _tempFile); testCase.CodeFilePath = _tempFile; var describe = name.Split('.').First(); var set = new TestCaseSet(_tempFile, describe); set.TestCases.Add(testCase); return(set); }
public static void ClassInitialize(TestContext testContext) { testCaseSet = TestCaseSet <ParserComposerTestCase> .FromStream(IoUtilities.GetResourceStream( "Input.ParserComposerTestCases.txt")); }