示例#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();
 }
示例#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();
     }
 }
示例#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();
 }
示例#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();
    }
 }