I have been told that the automatically generated tests in VS2008 can be made compatible with NUnit just by adding
#if !NUNIT
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestContext = System.String;
using DeploymentItem = NUnit.Framework.DescriptionAttribute;
#endif
EDIT: The question slightly changed focus since i fixed the reference issue. Again, I was told this statement would work to change to the correct unit test program, VS or NUnit.
It never goes into the else statement. So the new question is, do i need to change the conditional to something else, or am I missing something simple again?
Well I found out what to do after I overlooked the simple mistake Richard pointed out to me.
Since I am running these in CC.NET I just took the easy way out for the variable and set a windows variable in cmd and then ran the dll with nunit-console.exe.
If you don’t really care about being able to swap back and forth between VS2008 and NUnit testings programs you can just take out the precompile code, leaving the contents of the if for VS and the contents of else for NUnit.