Created
April 25, 2021 01:59
-
-
Save SaahilClaypool/d0087f3a9f61df47279c5f90d1308183 to your computer and use it in GitHub Desktop.
In-project unit tests c#
This file contains hidden or 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> | |
<TargetFramework>net6.0</TargetFramework> | |
<GenerateProgramFile>false</GenerateProgramFile> | |
<!-- This stops c# from creating th stub main automatically --> | |
<!-- https://andrewlock.net/fixing-the-error-program-has-more-than-one-entry-point-defined-for-console-apps-containing-xunit-tests/ --> | |
</PropertyGroup> | |
<ItemGroup Condition="'$(Configuration)' == 'Release'"> | |
<Compile Remove="**\*.Test.cs" /> | |
</ItemGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> | |
<PackageReference Include="xunit" Version="2.4.1" /> | |
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
<PrivateAssets>all</PrivateAssets> | |
</PackageReference> | |
<PackageReference Include="coverlet.collector" Version="1.3.0"> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
<PrivateAssets>all</PrivateAssets> | |
</PackageReference> | |
</ItemGroup> | |
</Project> |
Author
SaahilClaypool
commented
May 3, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment