使用NUnit3控制台运行测试

Cod*_*ker 2 c# nunit nuget nunit-3.0 .net-core

我正在尝试使用NUnit Console Runner通过命令行运行测试:https : //github.com/nunit/docs/wiki/Console-Runner

我已经在我的NuGet中安装了https://www.nuget.org/packages/NUnit.ConsoleRunner/ NUnit.ConsoleRunner

我在中打开了命令行位置\sanitized\bin\Debug\netcoreapp2.1。我使用https://github.com/nunit/docs/wiki/Console-Command-Line中NUNIT3-CONSOLE myTests.dll提到的命令运行测试

但是我得到了错误:

NUNIT3-CONSOLE:找不到命令

我应该使用什么命令?

注意:这是一个.netcore应用程序

Pes*_*ska 5

NUnit控制台当前不适用于.net核心:

NUnit控制台是使用完整的.NET Framework编译的,当前不支持.NET Core。要从命令行运行.NET Core测试,您需要使用dotnet test。有关如何执行此操作的信息,请参见 https://github.com/nunit/docs/wiki/.NET-Core-and-.NET-Standard

我们正在考虑创建一个基于.NET Core的控制台运行程序,但它仍处于计划阶段。

资料来源:https : //github.com/nunit/nunit-console/issues/487

只需dotnet test按照nunit Wiki中所述使用即可。