Ejemplo n.º 1
0
 public void RunTests(ITestRun testSelection, ITestListener listener)
 {
     SetUp();
     foreach (var tc in TestFixtures)
     {
         if (testSelection.Contains(tc))
         {
             if (!tc.IsIgnored)
             {
                 tc.Execute(testSelection, listener);
             }
             else
             {
                 listener.OnTestSkipped(this, new TestResultEventArgs(
                                            FullName, tc.FullName, string.Empty, tc.IgnoreReason, 0));
             }
         }
     }
     TearDown();
 }
Ejemplo n.º 2
0
 public void Execute(ITestRun testRun, ITestListener listener)
 {
     Use(listener);
     try {
         SafeCurrentDirectory();
         if (CreateObject() &&
             FixtureSetUp())
         {
             foreach (var testMethod in _testMethods)
             {
                 if (!testMethod.Ignore)
                 {
                     if (testRun.Contains(testMethod) &&
                         SetUp(testMethod))
                     {
                         testMethod.Execute(_testListener);
                         TearDown(testMethod);
                     }
                 }
                 else
                 {
                     _testListener.OnTestSkipped(new TestFixtureInfo(this),
                                                 new TestResultEventArgs(
                                                     AssemblyName,
                                                     FullName,
                                                     testMethod.Name,
                                                     testMethod.IgnoreReason,
                                                     0)
                     {
                         TestResult = TestResultCategory.Skipped
                     });
                 }
             }
             FixtureTearDown();
         }
     }
     finally {
         RestoreCurrentDirectory();
     }
 }
Ejemplo n.º 3
0
 public void RunTests(ITestRun testSelection, ITestListener listener) {
    SetUp();
    foreach( var tc in TestFixtures ) {
       if( testSelection.Contains(tc) ) {
          if(!tc.IsIgnored) {
             tc.Execute(testSelection, listener);
          }
          else {
             listener.OnTestSkipped(this, new TestResultEventArgs(
                                             FullName, tc.FullName, string.Empty, tc.IgnoreReason, 0));
          }
       }
    }
    TearDown();
 }
Ejemplo n.º 4
0
 public void Execute(ITestRun testRun, ITestListener listener) {
    Use(listener);
    try {
       SafeCurrentDirectory();
       if( CreateObject()
          && FixtureSetUp() ) {
          foreach( var testMethod in _testMethods ) {
             if( !testMethod.Ignore ) {
                if( testRun.Contains(testMethod)
                   && SetUp(testMethod) ) {
                   testMethod.Execute(_testListener);
                   TearDown(testMethod);
                }
             }
             else {
                _testListener.OnTestSkipped(new TestFixtureInfo(this),
                                            new TestResultEventArgs(
                                               AssemblyName,
                                               FullName,
                                               testMethod.Name,
                                               testMethod.IgnoreReason,
                                               0){TestResult = TestResultCategory.Skipped});
             }
          }
          FixtureTearDown();
       }
    }
    finally {
       RestoreCurrentDirectory();
    }
 }