views:

25

answers:

1

Maybe I am just forgetting something, but I cannot seem to get NUnit to work in Visual Studio 2008 Standard Edition. I am trying to use NUnit 2.5.7 in a C# class library project. I am following the structure of the samples given in the download of NUnit.

Here are the steps I am doing
1) Download and install NUnit 2.5.7
2) Create C# class library project
3) Add reference of NUnit.Framework to my project
4) Create a class
5) Add "using NUnit.Framework"
6) Add [TestFixture] at top of my class from step 3

The issue comes at step 6, Visual Studio does not recognize the TestFixtureAttribute or the TestAttribute at all. The samples included with the NUnit download simply have the using statement in step 5, and the [TestFixture]. What am I missing?

using System;
using NUnit.Framework;

namespace UnitTests
{
    [TestFixture]
    public class MyUnitTests
    {

        [Test]
        public void TestMethod1()
        {
            //my unit test
        }    

    }
}

Thanks

+1  A: 

Can you veiw the NUnit.Framework in the object browser?

BitOff
That was it. I had actually not referenced NUnit.Framework. I had NUnit.Core, yet I was not getting an error about the using NUnit.Framework (using something I had no reference to). I swapped the reference and all is good!!!
Dan Appleyard