Skip to content

Commit 8875a1b

Browse files
committed
fix(templates): scope netfx coverage shim
1 parent e1277cb commit 8875a1b

6 files changed

Lines changed: 8 additions & 6 deletions

File tree

TUnit.Templates.Tests/Snapshots/InstantiationTestWithNetFramework.TUnit.--framework#net48.verified/TUnit/HooksAndLifecycle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Diagnostics.CodeAnalysis;
22

3-
[assembly: ExcludeFromCodeCoverage]
3+
[assembly: TUnit.Polyfills.ExcludeFromCodeCoverage]
44

55
namespace TUnit;
66

TUnit.Templates.Tests/Snapshots/InstantiationTestWithNetFramework.TUnit.--framework#net48.verified/TUnit/Polyfills/ExcludeFromCodeCoverageAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace System.Diagnostics.CodeAnalysis;
1+
namespace TUnit.Polyfills;
22

33
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event, Inherited = false, AllowMultiple = false)]
44
internal sealed class ExcludeFromCodeCoverageAttribute : Attribute

TUnit.Templates.Tests/Snapshots/InstantiationTestWithNetFramework.TUnit.--framework#net48.verified/TUnit/TUnit.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<TargetFramework>net48</TargetFramework>
88
<LangVersion>preview</LangVersion>
99
<EnableTUnitPolyfills>false</EnableTUnitPolyfills>
10-
<NoWarn>$(NoWarn);CS0592;CS0436</NoWarn>
1110
</PropertyGroup>
1211

1312
<ItemGroup>

TUnit.Templates/content/TUnit/HooksAndLifecycle.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
using System.Diagnostics.CodeAnalysis;
22

3+
#if (IsNetFramework)
4+
[assembly: TestProject.Polyfills.ExcludeFromCodeCoverage]
5+
#else
36
[assembly: ExcludeFromCodeCoverage]
7+
#endif
48

59
namespace TestProject;
610

TUnit.Templates/content/TUnit/Polyfills/ExcludeFromCodeCoverageAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace System.Diagnostics.CodeAnalysis;
1+
namespace TestProject.Polyfills;
22

33
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event, Inherited = false, AllowMultiple = false)]
44
internal sealed class ExcludeFromCodeCoverageAttribute : Attribute

TUnit.Templates/content/TUnit/TestProject.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
<!--#if (IsNetFramework) -->
99
<LangVersion>preview</LangVersion>
1010
<EnableTUnitPolyfills>false</EnableTUnitPolyfills>
11-
<NoWarn>$(NoWarn);CS0592;CS0436</NoWarn>
1211
<!--#endif -->
1312
</PropertyGroup>
1413

1514
<ItemGroup>
1615
<PackageReference Include="TUnit" Version="1.5*" />
1716
<!--#if (IsNetFramework) -->
18-
<PackageReference Include="Polyfill" Version="10.8.*" PrivateAssets="all" />
17+
<PackageReference Include="Polyfill" Version="10.11.2" PrivateAssets="all" />
1918
<!--#endif -->
2019
</ItemGroup>
2120

0 commit comments

Comments
 (0)