nunit-console can not loacte fixture

Posted by tguclu on Stack Overflow See other posts from Stack Overflow or by tguclu
Published on 2010-12-24T13:51:04Z Indexed on 2010/12/24 13:54 UTC
Read the original article Hit count: 384

Filed under:

Hi

I have 2.5.8 and VS2010

I want to run tests against a dll and if I type

>nunit-console a.dll

I also have these suites

namespace LicMgmtLib.Tests

{
    /// <summary>
    /// Contains the complete suite for LicMgmtLibTest project
    /// </summary>
    public class AllTests
    {
        [Suite]
        public static IEnumerable Suite
        {
            get
            {
                List<Type> suite = new List<Type>();
                foreach (Type testCase in UnitTests.Suite)
                {
                    suite.Add(testCase);
                }
                return suite;
            }
        }
    }
}

and

namespace LicMgmtLib.Tests
{
    /// <summary>
    /// Contains the unit test cases for LicMgmtLibTest project
    /// </summary>
    public class UnitTests
    {
        [Suite]
        public static IEnumerable Suite
        {
            get
            {
                List<Type> suite = new List<Type>();
                suite.Add(typeof(LicenceManagerTests));
                suite.Add(typeof(CertManagerTests));
                return suite;
            }
        }
    }

}

If I would like to run tests using Suites I type

nunit-console a.dll /fixture=AllTests.Suite

but it fails with the message

>Unable to locate fixture AllTests.Suite

If you wonder why I use Suites ,I don't know. We are using MSBuild in our project and this is a requirement of MSBuild I guess.

Any help appreciated Regards

© Stack Overflow or respective owner

Related posts about nunit