NUnit3.ConsoleRunner with .NET Core

I am trying to get the Nunit3.ConsoleRunner package version 3.70 of NuGet working in my .NET Core test build. I installed the NuGet package and found that it is in this place:

% USERPROFILE% \. NuGet \ packages \ NUnit.ConsoleRunner \ 3.7.0 \ tools \ nunit3-console.exe

If I ran the tool against my test build of .NET Core 1.1 as follows:

nunit3-console.exe MyTestAssembly.dll

I get the following errors (snippet from TestResults.xml):

<failure>
      <message><![CDATA[An exception occurred in the driver while loading tests.]]></message>
      <stack-trace><![CDATA[
Server stack trace: 
   at NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)
   at NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
   at NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded()
   at NUnit.Engine.Runners.DirectTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at NUnit.Engine.ITestEngineRunner.Run(ITestEventListener listener, TestFilter filter)
   at NUnit.Engine.Runners.ProcessRunner.RunTests(ITestEventListener listener, TestFilter filter)]]></stack-trace>
    </failure>

I also have the NUnit3TestAdapter NuGet package installed in this assembly (version 3.8.0-alpha1) and it works well and all tests pass. What am I missing when running nunit3-console.exe regarding a .NET Core project? I have a .NET 4.5.2 application with no problems.

+4

Source: https://habr.com/ru/post/1681750/


All Articles