Well I have been looking at VS.Net 2005 some since it has released.  I wanted to try out some of the new features.  Well I am pretty attached to using NUnit so once I got a little bit of code going in VS.Net 2005 I decided it was time to try NUnit.  Fortunately there is a new iteration release of NUnit (2.2.3) that works with VS.Net 2005. 

So I downloaded it and wrote my first test like I always do.  Create a test project, add a reference to NUnit, add a new class, put a TestFixture attribute on the class, and add a public method that returns void that also has the Test attribute. I then proceeded to fire up NUnit GUI and run the test. However the test I wrote does not show up in the GUI. I fiddled around with the test code for a while and I even downloade the NUnit source code to try and figure out why my test was not seen by NUnit. Well after about 30 minutes of messing around I realized that when you add a new class to VS.Net 2005 project it looks like the following

using System;
using System.Collections.Generic;
using System.Text;
namespace ProtoSystem.Scrum.Business.Tests
{   
   class Class1
   {
   }
}
I never noticed the fact that public does not appear before the keyword class. So the test class could not be seen by NUnit.

Comments


Comments are closed