一个新实现的基于 TUnit 的单元测试项目,用 dotnet test 命令运行测试,出现下面的错误:
dotnet test
Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later. If you use dotnet test, you should opt-in to the new dotnet test experience
请问如何解决?
在项目根目录中创建 global.json 文件并添加下面的内容即可解决
{ "test": { "runner": "Microsoft.Testing.Platform" } }