Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does .NET Core work with the NUnit console runner?

I have a very simple test!

[Test]
public void TestMethod1()
{
    Assert.IsTrue(false);
}

When I try to run this with nunit3-console.exe I get the following error.

NUnit.Engine.NUnitEngineException : The NUnit 3 driver encountered an error while executing reflected code. ----> System.InvalidCastException : Unable to cast transparent proxy to type 'System.Web.UI.ICallbackEventHandler'. --NUnitEngineException

I am running .NET Core 2.1, with NUnit Console Runner 3.9 and NUnit test adapter 3.1. I did do a Google search and got conflicting answers. Am I missing something?

like image 339
Maccurt Avatar asked Oct 16 '18 12:10

Maccurt


People also ask

Does NUnit work with .NET core?

Sdk version 17.0. 0 to your NUnit test projects will also enable the dotnet test command for . NET Core projects.

Does NUnit support .NET framework?

NUnit is an open-source unit testing framework for the . NET Framework and Mono.


1 Answers

I reached out to the NUnit community and got this answer: Does NUnit Console work with .NET Core? #487

NUnit Console is compiled using the full .NET Framework and does not currently support .NET Core. To run .NET Core tests from the command line, you need to use dotnet test. For information on how to do this, see .NET Core and .NET Standard (NUnit wiki).

We are looking at creating a .NET Core based console runner, but it is still in the planning stages.

like image 150
Maccurt Avatar answered Sep 23 '22 16:09

Maccurt