Re: nunit tests hold onto file handles aftertestsaredone

"David Jeske" <[email protected]> Tue, 24 Jun 2008 11:11:40 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
On Tue, Jun 24, 2008 at 6:12 AM, Charlie Poole
<[email protected]> wrote:
> When you're in the teardown, the test method that was just executed is no
> longer on the stack. That's why this requires some extra support from NUnit,
> which knows what test it just finished executing.

I'm aware of that.. I'm planning to use this inside my test.. here is
an example:

[TestFixture]
public class BlahTests {
  String dirname;
  bool testPassed;

  [SetUp]
  public void setupBlahTests() {
      if (this.dirname) {
         if (this.testPassed) {
            clean(this.dirname);
         }
      }

      this.dirname = null;
      this.testPassed = false;
  }

  [Test]
  public void TestA() {
     this.dirname  = allocateDirnameForMyMethodName();

     // test body

     this.testPassed = true;
  }

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php