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