private void initializeTestProfile() { try { if (!string.IsNullOrEmpty(Program.TestPerformanceFile)) { m_testProfileUri = new Uri(TestProperties.ExpandString(Program.TestPerformanceFile)); m_testTreeView.TestProfile = TestProfile.ReadFromFile(m_testProfileUri.LocalPath); } } catch (FileNotFoundException) { MessageBox.Show( string.Format("Unable to locate test performance file \"{0}\".\r\n\r\nPlease verify the file path.", Program.TestPerformanceFile), "Quintity TestEngineer", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (SerializationException) { MessageBox.Show( string.Format("Unable to read test performance \"{0}\".\r\n\r\nPlease verify the file is a valid test performance file.", Program.TestPerformanceFile), "Quintity TestEngineer", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (UriFormatException) { MessageBox.Show( string.Format("Unable to read test performance \"{0}\".\r\n\r\nPlease verify the file is a valid test performance file.", Program.TestPerformanceFile), "Quintity TestEngineer", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception e) { MessageBox.Show(e.Message, "Quintity TestEngineer", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public TestVerdict WritePerformanceConfig(string filePath) { try { Setup(); var testProfile = new TestProfile(2, new TimeSpan(0, 0, 0, 30, 300), "TestAnalyst"); TestProfile.WritetoFile(testProfile, filePath); testProfile = TestProfile.ReadFromFile(filePath); TestVerdict = TestVerdict.Pass; TestMessage = testProfile.ToString(); } catch (Exception e) { TestMessage += e.ToString(); TestVerdict = TestVerdict.Error; } finally { Teardown(); } return(TestVerdict); }
private static TestProfile initializeTestProfile(string testPerformanceFile) { TestProfile testProfile = null; try { if (!string.IsNullOrEmpty(testPerformanceFile)) { var testProfileUri = new Uri(TestProperties.ExpandString(testPerformanceFile)); testProfile = TestProfile.ReadFromFile(testProfileUri.LocalPath); } } catch (FileNotFoundException) { LogEvent.Fatal( string.Format("Unable to locate test performance file \"{0}\".\r\n\r\nPlease verify the file path.", testPerformanceFile)); exitCode = ExitCode.TestProfileError; } catch (SerializationException) { LogEvent.Fatal( string.Format("Unable to read test performance \"{0}\".\r\n\r\nPlease verify the file is a valid test performance file.", testPerformanceFile)); exitCode = ExitCode.TestProfileError; } catch (UriFormatException) { LogEvent.Fatal( string.Format("Unable to read test performance \"{0}\".\r\n\r\nPlease verify the file is a valid test performance file.", testPerformanceFile)); exitCode = ExitCode.TestProfileError; } catch (Exception e) { LogEvent.Fatal(e.Message); exitCode = ExitCode.TestProfileError; } return(testProfile); }