Created
December 3, 2019 15:52
-
-
Save tracker1/4f184c35208e7b9a3922f69ffb0adaca to your computer and use it in GitHub Desktop.
DotNet Core 3, XUnit, Integrated Tests With Coverage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<!-- Add to be able to test default assembly --> | |
<GenerateProgramFile>false</GenerateProgramFile> | |
<TargetFramework>netcoreapp3.0</TargetFramework> | |
<RootNamespace>ProjectName</RootNamespace> | |
<!-- Needed to exclude *.Test.cs from Release Build --> | |
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="coverlet.msbuild" Version="2.7.0"> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
<PrivateAssets>all</PrivateAssets> | |
</PackageReference> | |
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" /> | |
<PackageReference Include="xunit" Version="2.4.1" /> | |
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
<PrivateAssets>all</PrivateAssets> | |
</PackageReference> | |
</ItemGroup> | |
<!-- Needed Non-Release Build, include *.Test.cs --> | |
<ItemGroup Condition="'$(Configuration)' != 'Release'"> | |
<Compile Include="**/*.cs" /> | |
</ItemGroup> | |
<!-- Needed Release Build, exclude *.Test.cs --> | |
<ItemGroup Condition="'$(Configuration)' == 'Release'"> | |
<Compile Include="**/*.cs" Exclude="**/*.Test.cs" /> | |
</ItemGroup> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment