Compile error in NUnitTestAdapterTest.cs

Mar 4, 2009 at 2:38 PM
I had to comment out method RunOrderTest in NUnitTestAdapterTest.cs because when I try to  Build/Batch Build.../Select All, I get this error message in Visual Studio Team System 2008 Developer Edition, Service Pack 1:

The type or namespace name 'TestFixtureOrderTwo' does not exist in the namespace 'NUnitTest.UnitTest.Targets' (are you missing an assembly reference?)

Workaround: surround method RunOrderTest() if #if/#endif that is never true and keep fingers crossed that it isn't fatal to do so.

  110 #if DONT_USE_FRED_MORRISON_WORKAROUND
  111         /// <summary>
  112         ///A test for Run
  113         ///</summary>
  114         [TestMethod()]
  115         public void RunOrderTest()
  116         {
  117             Type testClassType = typeof(TestTarget.TestFixtureOrderTwo);
  118             Assembly assembly = testClassType.Assembly;
  119             string[] testNames = {"TestOne", "TestTwo"};
  120 
  121             List<ITestElement> testElements = new List<ITestElement>();
  122             foreach (string testName in testNames)
  123             {
  124                 DummyTest test = CreateTestDummy(testClassType, testName);
  125 
  126                 UnitTestElement testElement = new UnitTestElement(test, assembly);
  127                 testElement.HostType = "NUnit";
  128                 testElements.Add(testElement);
  129             }
  130 
  131             string actual = ExecuteAdapterTestRun(testClassType, assembly, testElements.ToArray());
  132 
  133             Assert.IsFalse(actual.Contains("Error"));
  134             Assert.IsTrue(actual.Contains("Outcome: Passed"));
  135             Assert.IsTrue(actual.Contains(testNames[0]));
  136             Assert.IsTrue(actual.Contains(testNames[1]));
  137         }
  138 #endif
<!--EndFragment-->
Coordinator
Apr 6, 2009 at 9:28 PM
Edited Apr 7, 2009 at 6:40 AM
Hmm... That one seems to reference to a unittest which wasn't checked in.
This unuittest tests if the execution order of NUnitForVS resembles the vanilla NUnit execution.
The workaround you described isn't fatal, but I checked in the unittest so its not needed anymore.