Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top