使用NUnit3控制台运行测试

问题描述 投票:0回答:1

我正在尝试使用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的命令行位置。我使用NUNIT3-CONSOLE myTests.dll中提到的命令https://github.com/nunit/docs/wiki/Console-Command-Line运行我的测试

但我得到错误:

NUNIT3-CONSOLE:未找到命令

我应该使用什么命令?

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

c# .net-core nuget nunit nunit-3.0
1个回答
3
投票

NUnit Console目前不适用于.net核心:

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

我们正在寻找创建基于.NET Core的控制台运行器,但它仍处于规划阶段。

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

只需使用nunit wiki中描述的dotnet test

© www.soinside.com 2019 - 2024. All rights reserved.