tags:

views:

206

answers:

2

I Have a really simple test class as below.

For some reason my test is being ignored by the GUI and coming up yellow.

I have updated the framework and runner to 2.4.8 as I thought it might have been differences between versions being the problem.

using System;
using NUnit.Framework;

namespace TestRunner
{
    [TestFixture]
    class TestMe
    {

        [Test]
        public void TestBob()
        {
            Assert.IsTrue(true);
        }
   }
}
+11  A: 

Your TestMe class needs to be public.

Here is some documentation on the requirements for classes marked with the TestFixture attribute that discusses the conditions under which a class may not be recognized as a test fixture.

tvanfosson
That should be it
Perpetualcoder
+3  A: 

You didn't specify an access modifier for your class; therefore, your class is internal by default and NUnit does not see your class.

If you specify the public access modifier for your class that contains the Tests, then it should just work:

[TestFixture]
public class TestMe
{
    [Test]
    public void TestBob()
    {
       Assert.AreEqual ("Bob", "Bob");
    }
}
Frederik Gheysels
Thanks very much for the answer.
GordyII