1

I made NUnit unit test for my c# program but I'm having trouble running the tests with NUnit 3.11.0: I compiled my C# solution with csc with the following command:

csc Program.cs ProgramTest.cs /r:nunit.framework.dll -out:Program.exe

When I open the tests in monodevelop everything works fine but when trying to open the executable with nunit-console or nunit-gui I get the following error:

NUnit.Core.UnsupportedFrameworkException: Skipped loading assembly Program because it references an unsupported version of the nunit.framework, 3.11.0

Also seen here. And here is the log given by nunit-gui.

Before all that I tried compiling the project with an earlier version of NUnit but got the following error:

Program.cs(162,15): error CS0117: `NUnit.Framework.FileAssert' does not contain a definition for `Exists'

NUnit does not seem to know FileAssert.Exists(). This is why I tried compiling it with NUnit 3.11.0.

Does anyone know how can I run my tests with NUnit3 or make my compiler know about FileAssert.Exists() ?

csc version:

Microsoft (R) Visual C# Compiler version 2.8.2.62916 (2ad4aabc)

OS: Ubuntu 18.04

Thanks.

2 Answers2

1

I would say you have a different version of nunit runner than nunit dll used for compilation of your program. You need the same version (especially do not try to combine nunit version 2 vs 3).

Version of C# compiler and operation system should not be important here.

Al Kepp
  • 5,831
  • 2
  • 28
  • 48
0

Indeed my version of the nunit runner (nunit-gui and nunit-console) was too old for NUnit 3. I changed it to TestCentric and now it works !