对于几个项目,我有一个通用的util项目,该项目由一些基本测试类,帮助程序类等组成。 项目定义如下所示:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>SomeRoot.Util</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.2" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>
</Project>
I assume that since it references xUnit, that both the visual studio and the dotnet test
command treat it like a test project.
But since it isn't I would like to somehow prevent both the visual studio and dotnet test
to not recognize this project as a test project.
不能删除对xUnit的引用,因为基类需要xUnit包中的某些接口。