@@ -60,18 +60,18 @@ dotnet add package bunit --version #{NBGV_NuGetPackageVersion}#
6060The test projects setting needs to be set to the following:
6161
6262- the project's SDK needs to be set to ` Microsoft.NET.Sdk.Razor `
63- - set the ` <TargetFramework> ` to ` net5 .0`
63+ - set the ` <TargetFramework> ` to ` net6 .0`
6464
6565> [ !NOTE]
66- > bUnit works with ` netcoreapp3.1 ` and ` netstandard2.1 ` test projects as well.
66+ > bUnit works with ` net5.0 ` and ` netcoreapp3.1 ` / ` netstandard2.1 ` test projects as well.
6767
6868To do so, change the first part of the test projects ` .csproj ` file to look like this.:
6969
7070``` xml
7171<Project Sdk =" Microsoft.NET.Sdk.Razor" >
7272
7373 <PropertyGroup >
74- <TargetFramework >net5 .0</TargetFramework >
74+ <TargetFramework >net6 .0</TargetFramework >
7575 </PropertyGroup > ...
7676
7777</Project >
@@ -94,16 +94,22 @@ The result should be a test project with a `.csproj` that looks like this (non b
9494<Project Sdk =" Microsoft.NET.Sdk.Razor" >
9595
9696 <PropertyGroup >
97- <TargetFramework >net5.0</TargetFramework >
97+ <TargetFramework >net6.0</TargetFramework >
98+ <Nullable >enable</Nullable >
99+ <IsPackable >false</IsPackable >
98100 </PropertyGroup >
99101
100102 <ItemGroup >
101103 <PackageReference Include =" bunit" Version =" #{RELEASE-VERSION}#" />
102- <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.7.1 " />
104+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.11.0 " />
103105 <PackageReference Include =" xunit" Version =" 2.4.1" />
104106 <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.4.3" >
107+ <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
105108 <PrivateAssets >all</PrivateAssets >
109+ </PackageReference >
110+ <PackageReference Include =" coverlet.collector" Version =" 3.1.0" >
106111 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
112+ <PrivateAssets >all</PrivateAssets >
107113 </PackageReference >
108114 </ItemGroup >
109115
@@ -120,19 +126,19 @@ The result should be a test project with a `.csproj` that looks like this (non b
120126<Project Sdk =" Microsoft.NET.Sdk.Razor" >
121127
122128 <PropertyGroup >
123- <TargetFramework >net5.0</TargetFramework >
129+ <TargetFramework >net6.0</TargetFramework >
130+ <Nullable >enable</Nullable >
131+ <IsPackable >false</IsPackable >
124132 </PropertyGroup >
125133
126- <ItemGroup >
127- <PackageReference Include =" bunit" Version =" #{RELEASE-VERSION}#" />
128- <PackageReference Include =" nunit" Version =" 3.12.0" />
129- <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.7.1" />
130- <PackageReference Include =" NUnit3TestAdapter" Version =" 3.16.1" >
131- <PrivateAssets >all</PrivateAssets >
132- <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
133- </PackageReference >
134+ <ItemGroup >
135+ <PackageReference Include =" bunit" Version =" #{RELEASE-VERSION}#" />
136+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.11.0" />
137+ <PackageReference Include =" NUnit" Version =" 3.13.2" />
138+ <PackageReference Include =" NUnit3TestAdapter" Version =" 4.0.0" />
139+ <PackageReference Include =" coverlet.collector" Version =" 3.1.0" />
134140 </ItemGroup >
135-
141+
136142 <ItemGroup >
137143 <ProjectReference Include =" <PATH TO COMPONENT LIB>.csproj" />
138144 </ItemGroup >
@@ -146,17 +152,19 @@ The result should be a test project with a `.csproj` that looks like this (non b
146152<Project Sdk =" Microsoft.NET.Sdk.Razor" >
147153
148154 <PropertyGroup >
149- <TargetFramework >net5.0</TargetFramework >
155+ <TargetFramework >net6.0</TargetFramework >
156+ <Nullable >enable</Nullable >
157+ <IsPackable >false</IsPackable >
150158 </PropertyGroup >
151159
152160 <ItemGroup >
153- <PackageReference Include =" bunit" Version =" #{RELEASE-VERSION}#" />
154- <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.7.1 " />
155- <PackageReference Include =" MSTest.TestAdapter" Version =" 2.1.0 " />
156- <PackageReference Include =" MSTest.TestFramework" Version =" 2.1.0 " />
157- <PackageReference Include =" coverlet.collector" Version =" 1.2 .0" />
158- </ItemGroup >
159-
161+ <PackageReference Include =" bunit" Version =" #{RELEASE-VERSION}#" />
162+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.11.0 " />
163+ <PackageReference Include =" MSTest.TestAdapter" Version =" 2.2.7 " />
164+ <PackageReference Include =" MSTest.TestFramework" Version =" 2.2.7 " />
165+ <PackageReference Include =" coverlet.collector" Version =" 3.1 .0" />
166+ </ItemGroup >
167+
160168 <ItemGroup >
161169 <ProjectReference Include =" <PATH TO COMPONENT LIB>.csproj" />
162170 </ItemGroup >
0 commit comments