Ejemplo n.º 1
0
 private static void ReportResultAsProgressReport(IProgress<ProgressReport> progress, TestResult result)
 {
     progress.Report(new ProgressReport
         {
             Message = result.TestName + " : " + (result.IsSuccess ? "Passed" : "Failed")
         });
 }
Ejemplo n.º 2
0
 private static TestResult RunTest(RavenTestsGroup testGroup, MethodInfo test, object obj)
 {
     var watch = new Stopwatch();
     var result = new TestResult {TestName = testGroup.GroupType.FullName + "." + test.Name};
     try
     {
         watch.Start();
         test.Invoke(obj, new object[0]);
         result.IsSuccess = true;
     }
     catch (TargetInvocationException ex)
     {
         result.IsSuccess = false;
         result.Exception = ex.InnerException;
     }
     catch (Exception ex)
     {
         result.IsSuccess = false;
         result.Exception = ex;
     }
     finally
     {
         watch.Stop();
         result.ExecutionTime = watch.Elapsed;
     }
     return result;
 }