Irony update Nov 12 - now with NUnit, but VSTest might have problems

Coordinator
Nov 12, 2010 at 9:48 PM

Hi everybody

Just uploaded new code drop, with a few minor fixes and NUnit support. Now you can run tests in both environments - VS Test or NUnit. There are two test projects in the solution for each option plus conditional attribute renaming in source code (test are shared between the two projects).

After doing all this, checking in, getting all back from codeplex I found a problem. I usually update the zip on Downloads page right after I do the checkin. I download the sources back, open VS, remove source control bindings (to make things easier for those who will use the downloads), build, run unit tests, etc. It turns out, after I removed bindings and disconnected from TFS (codeplex), VS Tests stopped working. Attempt to run the test project pops up a box with a message "The target of invocation had thrown an exception". If you experience the same effect, here's the situation.

It turned out it is a known problem - read the following post, and there are several workarounds there:

http://chezray.linklord.com/roller/chezray/entry/unit_tests_failing_with_exception

what worked for me is simply reconnecting with TFS (without binding the project) - after reconnection it started working. Alternatively you can consider deleting the registry key as described.

On another theme, I'm preparing to move to VS 2010/.NET 4. I'm planning to make project runnable in both environments for a while. In the current version you'll notice that I added suffix "2008" to project and solution files. Next time there will be 2010 versions.

Roman

Nov 13, 2010 at 2:24 PM

Hi Roman,

Thanks for adding the NUnit stuff.  Just curious why you want to support both frameworks?  With TestDriven.Net (http://www.testdriven.net/download.aspx) you can easily run NUnit within Visual Studio and its free to use on open source project.  There are subtle differences in the NUnit and MStest APIs (particularly that testing for exceptions in NUnit is much nicer), I'm concerned that the unit tests will end up being a jumble of preprocessor directives to properly support both frameworks.

Coordinator
Nov 14, 2010 at 5:17 PM

As you can see in Irony's tests, they use only very basic facilities (Assert helper class), which is very similar in both environments. So for now, a single #if statement at the top of the file is enough.

As for other things like TestDriven.NET, I would prefer not to introduce more dependencies on other frameworks; I think NUnit/VSTest is enough for now.

Roman