Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NUnit [Test] is not a valid attribute

I've included the necessary assemblies into a Windows Class project in VS2008. When I start to try to write a test I get a red squiggle line and the message [Test] is not a valid attribute. I've used NUnit before... maybe an earlier version. What am I doing wrong? I'm on version 2.5.2.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit;
using NUnit.Core;
using NUnit.Framework;

namespace MyNamespace
{
    public class LoginTests
    {
        [Test]
        public void CanLogin()
        {
        }
    }
}
like image 341
BuddyJoe Avatar asked Dec 18 '22 02:12

BuddyJoe


1 Answers

I had a similar problem to this using version 2.5.3. The problem was that I was looking for the dll files in the "lib" directory of my nunit installation when I should have been looking in the "framework" directory. So when I referenced the "framework\nunit.framework.dll" dll everything worked. Hope this helps

like image 92
Anonymous Avatar answered Jan 03 '23 00:01

Anonymous