Struggling with NUnit

NUnit is a free open source framework and software to help run automated Unit Tests.  It’s great, it’s widely documented, and has a good community.  But for some reason I’ve been having trouble with the newest versions (currently 2.5.5).

Basically what was happening was that I would create the TestFixture class, the simple test functions, compile this into a .dll and open it in NUnit, like so:

Great, everything passed (as it should, I’m working out of Roy Osherove’s “The Art of Unit Testing”).

Except one problem kept showing up, when I’d then make a new function/change/whatever to the test class in Visual Studio 2008, I’d get the compile error that the .dll that VS is trying to rebuild “is being used by another process.”   This simply means another application is using the .dll or really that NUnit hasn’t released the file.  The frustrating solution was to close NUnit after each test, recompile then reopen the NUnit GUI and re-run the test.  That’s too much, and shouldn’t have to be done.

So I searched their googlegroups http://groups.google.com/group/nunit-discuss, and the only other posts about this mentioned memory leaks or not properly cleaning up resources in the Test.  I realized (the latter) can’t be the case seing that this was happening with the sample C# solutions/projects that shipped with NUnit!

Surprised to say the least, the final solution was going back to an older version, 2.5.1.  Currently 2.5.5 is the newest release, I tried 2.5.4, same problem, then saw a note in a post about the same issue that 2.5.1 didn’t seem to have the same issue.

Uninstalled 2.5.4 -> installed 2.5.1, and like magic no lockups on the library you’re testing.

Advertisement
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s