Re: nunit tests hold onto file handlesaftertestsaredone
"Charlie Poole" <[email protected]> Tue, 24 Jun 2008 12:01:32 -0700
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <005701c8d62c$b92dc9f0$6401a8c0@ferrari> |
I must have misunderstood... I thought you were talking about examining the stack in the teardown to see what test had just executed. Charlie > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf > Of David Jeske > Sent: Tuesday, June 24, 2008 11:12 AM > To: Charlie Poole > Cc: [email protected] > Subject: Re: [Nunit-users] nunit tests hold onto file > handlesaftertestsaredone > > 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 > _______________________________________________ > Nunit-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/nunit-users > ------------------------------------------------------------------------- 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