NUnit 2.4 has a new extension feature called NUnit Add Ins. With these Add-Ins it is possible to extend NUnits capabilities without hacking the NUnit code base. This is a great step forward, although it is a feat that MBUnit has been doing for quite some time now.
The best way to understand how to write an Add-In is to download the source files and browse the examples in the samples\Extensibility\Core\ directory.
To install an Add-in copy it to the addin directory.
There is an undocumented feature that installs Add-Ins that are defined in the tested assembly, this is done by searching for an Attribute on all the Types in the assembly. The only reason that I know about this feature is that our tests failed once we upgraded to NUnit 2.4.
Our NUnit assemblies are part of the source code tree – a good practice as it allows the build to be repeatable, without requiring installations.
But NUnit kept on telling us that it couldn’t find an nunit.framework.dll (!?!). We fixed this by telling visual studio to copy the dll to the output directory (reference->Properties->Copy Local->true).
The reason that NUnit crashed, was because it was searching for the NUnit AddIn Attribute in our test assembly (and was doing this after changing the working directory)
What is completely missing from this feature is an easy way to install add-ins. Copying dll’s to addin directories simply doesn’t cut it. To Install an addin, you will have to search for all the addin directories of all nunit installations!!!
The install.bat that is distributed with the examples should have been a big sign that this deployment strategy is flawed.
Guess what, the NUnit guys are nearly there, just extend that pesky NUnit Attribute search that you are doing for the test assembly to all referenced assembly too and viola, there is no need to install the extensions.