2

I'm trying run tests from nunitlite-runner.exe but i got Error message

1) Invalid : /myfile.dll Has no TestFixtures

I have in source code

[TestFixture]
public class MyClassName
{
   [Order(1)]
   [Test]
   public void Case1()
   {
       //
   }

   [Order(2)]
   [Test]
   public void Case2()
   {
       //
   }
}

How can i fix code or run my tests?

qchar90
  • 404
  • 1
  • 5
  • 11
  • 1) What command-line do you use? 2) Are you sure that you are using the same build (runtime target) for both the framework you are referencing and nunitlite-runner? Your own tests should use a compatible target as well. – Charlie Aug 17 '17 at 15:24
  • 1) 2) When i started tests from VS all tests works properly. I'm not sure that i using the same nunit-runner. How can i check it? – qchar90 Aug 18 '17 at 12:00
  • I have a second project which works properly - i can run tests from cmd (it has text fixtures and testcases as above) – qchar90 Aug 18 '17 at 12:15

1 Answers1

1

I got this problem with nunit3-console.exe. I had, in my enthusiasm to upgrade to the latest and greatest, updated my NUnit project references to the latest version (3.9 at this writing), along with my console exe (3.7). But it seems that the console exe is a build or two behind the core libraries, so you can't reference a later version of NUnit than the version you have of the console exe.

I downgraded my NUnit project reference to 3.7, and that fixed it for me.

Shaul Behr
  • 36,951
  • 69
  • 249
  • 387
  • This should not be the case. Any 3.x version of the framework should run on any 3.x version of the console. If there are two specific version which do not work together - this is a bug, and NUnit would appreciate a bug report! =) – Chris Apr 13 '18 at 12:49