Ejemplo n.º 1
0
        internal override void Run(Reporter reporter)
        {
            if(Format != TestFormat.Skip)
            {
                try
                {
                    long beforeMemory = GC.GetTotalMemory(true);
                    StopWatch.Restart();

                    RunMethod();

                    long elapsedTime = StopWatch.ElapsedMilliseconds;
                    long totalMemory = beforeMemory - GC.GetTotalMemory(true);
                    StopWatch.Stop();

                    Result = new TestResult(TestStatus.Passed, elapsedTime, totalMemory);
                    reporter.CallBuildTestSuccess(this);
                }
                catch(Exception ex)
                {
                    Result = new TestResult(ex);
                    reporter.CallBuildTestFailure(this);
                }
            }
            else
            {
                Result = new TestResult(TestStatus.Skipped);
                reporter.CallBuildTestSkipped(this);
            }
        }
Ejemplo n.º 2
0
 internal override void Run(Reporter reporter)
 {
     if(Format != TestFormat.Skip)
     {
         reporter.CallBuildTestSuiteHeader(this);
         Tests.Run(reporter);
         Result = Tests.CreateTestSuiteResult();
         reporter.CallBuildTestSuiteFooter(this);
     }
     else
     {
         Result = new TestSuiteResult(TestStatus.Skipped);
     }
 }