gpt4 book ai didi

c# - 如何使用 csproj 在 .net core 中注册测试发现者

转载 作者:行者123 更新时间:2023-11-30 12:22:03 25 4
gpt4 key购买 nike

使用 dotnet migrate 升级我的 nunit 测试项目后,从 json 迁移到 csproj。我无法再运行我的测试。我收到一条消息说:

No test discoverer is registered to perform discovery of test cases. Register a test discoverer and try again.

引用这里是我的csproj文件

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../Jsonics/Jsonics.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="NUnit" Version="3.6.0" />
<PackageReference Include="dotnet-test-nunit" Version="3.4.0-beta-3" />
</ItemGroup>
</Project>

下一页告诉您如何为 xunit 和 mstest 而不是 nunit:

https://learn.microsoft.com/en-us/dotnet/articles/core/tools/project-json-to-csproj#testrunner

如何注册测试发现者?

最佳答案

他们正在更新适配器,请参阅 this tweet .

关于c# - 如何使用 csproj 在 .net core 中注册测试发现者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42666280/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com