Re: BackgroundWorker problems

"Lisle, Ron" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
Thanks. I think you're right. Another friend created a test application
which works just fine with NUnit. The primary difference appears to be
the inclusion of the backgroundworker in the individual test, instead of
in the startup method. I'm going to rearrange things similarly and see
if this fixes things. Thank you very much for the help.

 

________________________________

From: Nassar, Anthony [mailto:[email protected]] 
Sent: Tuesday, November 13, 2007 12:32 PM
To: Lisle, Ron; [email protected]
Subject: RE: [Nunit-users] BackgroundWorker problems

 

I think I've figured out the problem. NUnit has no reason to keep your
fixture class around once it's executed the small number of unit tests
in it, right? So the entire AppDomain is unloaded, and therefore the
form, and the BackgroundWorker component on it, get killed. The form's
OnDisposed and OnClosing methods never even get called; likewise the
completion callback.

 

I don't think you can do what you're trying to do here, though I'm not
sure exactly what you're trying to do. You're basically hoping that the
background task will complete before the appropriate test is called.
Unless you synchronize the thread on which the tests are running and the
background thread onto which the task is put, that's not gonna happen.
When I built delays in, the AppDomain still got unloaded by the test
runner (I'm using ReSharper, but it doesn't matter).

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.