Esempio n. 1
0
 private KeyValuePair <TestRun, List <MsTestError> > OpenTestResultFileAndGetResults(Project project, string fileName)
 {
     if (File.Exists(fileName))
     {
         VisualStudioDTE.TryOpenFile(fileName);
         var run = TestRun.LoadFromFile(fileName);
         List <MsTestError> failedTests = MsTestError.FromTestRun(run).ToList();
         foreach (var error in failedTests)
         {
             Output.WriteError($"{error.TestName}={error.ErrorMessage}", error.TestPath, error.Line, 0, null, TaskCategory.User, project.FullPath, File.Exists(error.TestPath), false);
         }
         SetTestRunOnResultsWindowToIndex(1);                 // Alle läufe in einem ergebis fenster zeigen
         return(new KeyValuePair <TestRun, List <MsTestError> >(run, failedTests));
     }
     return(new KeyValuePair <TestRun, List <MsTestError> >(null, new List <MsTestError>()));
 }