Fun with Mono, Rotor and DTE
I've just posted a new build of NUnitAddin. You should find running individual tests with the debugger much faster. It now only builds the current project (rather than the whole solution as it did before).
There are a couple of changes that will simplify testing ActiveX controls and .NET Remoting code. I have ensured that the test thread is always running as an STA (this should fix any problems with ActiveX controls). You should also find there are no remoting channels registered in the test AppDomain.
As I have mentioned before there is now a 'Test With...' menu. This lets you run tests in many different contexts. For example you can choose to test with the Mono, Rotor, .NET 1.1 or .NET 1.0 runtimes. You can also choose to run tests inside the VS.NET process. The fun thing about this is that you can have easy access to the VS.NET automation model. When you 'Test With... VS.NET' you can get hold of the DTE object like this...
using EnvDTE; class TestDTE { public static _DTE DTE { get { return (_DTE)AppDomain.CurrentDomain.GetData("DTE"); } } public void ListProjects() { foreach(Project project in DTE.Solution) { Debug.WriteLine(project.Name); } } }
Remember to 'Test With... VS.NET'! I always forget and wonder why it isn't working.
If you want to get it working with Mono/Rotor, have a look in the following directory and make sure the contents of the *.bat files are pointing at the correct locations.
%ProgramFiles%\NUnit Addin\runtimes\NUnitAddin.TestRunner.Runtimes\