Skip to content

Commit f03d4c8

Browse files
committed
Fixed target framework dependent test includes (exevute a lot more tests than before).
1 parent 35479ea commit f03d4c8

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

test/Serilog.Sinks.MSSqlServer.Tests/GlobalSuppressions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
[assembly: SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Supplying string literals and not using resources is accepted within this project.", Scope = "namespaceanddescendants", Target = "Serilog.Sinks.MSSqlServer.Tests")]
99
[assembly: SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Member names must match SQL server master DB objects.", Scope = "type", Target = "~T:Serilog.Sinks.MSSqlServer.Tests.TestUtils.sp_pkey")]
1010
[assembly: SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Member names must match SQL server master DB objects.", Scope = "type", Target = "~T:Serilog.Sinks.MSSqlServer.Tests.TestUtils.SysIndex_CCI")]
11-
[assembly: SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "In net452 there is no Contains() overload that accepts a StringComparison specifier", Scope = "member", Target = "~M:Serilog.Sinks.MSSqlServer.Tests.TestUtils.DatabaseTestsBase.VerifyLogMessageWasWritten(System.String)")]
11+
[assembly: SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "In net452 there is no Contains() overload that accepts a StringComparison specifier", Scope = "namespaceanddescendants", Target = "Serilog.Sinks.MSSqlServer.Tests")]

test/Serilog.Sinks.MSSqlServer.Tests/Serilog.Sinks.MSSqlServer.Tests.csproj

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net452;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>net452;net462;netcoreapp3.1</TargetFrameworks>
55
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0</TargetFrameworks>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
77
<AssemblyName>Serilog.Sinks.MSSqlServer.Tests</AssemblyName>
@@ -18,10 +18,7 @@
1818
<PackageReference Include="FluentAssertions" Version="5.10.3" />
1919
<PackageReference Include="Dapper.StrongName" Version="1.50.5" />
2020
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0" />
21-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
22-
<PrivateAssets>all</PrivateAssets>
23-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
24-
</PackageReference>
21+
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0"/>
2522
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
2623
<PackageReference Include="Moq" Version="4.14.1" />
2724
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
@@ -47,6 +44,14 @@
4744
<PackageReference Include="xunit" Version="2.4.1" />
4845
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
4946
<Compile Include="Configuration\Extensions\System.Configuration\**\*.cs" />
47+
</ItemGroup>
48+
49+
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
50+
<Reference Include="System" />
51+
<Reference Include="Microsoft.CSharp" />
52+
<PackageReference Include="xunit" Version="2.4.1" />
53+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
54+
<Compile Include="Configuration\Extensions\Hybrid\**\*.cs" />
5055
<Compile Include="Configuration\Implementations\System.Configuration\**\*.cs" />
5156
<Compile Include="Sinks\MSSqlServer\Platform\AzureManagedServiceAuthenticatorStubTests.cs" />
5257
</ItemGroup>
@@ -60,13 +65,10 @@
6065
<PackageReference Include="System.Text.Encoding.Extensions" Version="4.3.0" />
6166
<PackageReference Include="xunit" Version="2.4.1" />
6267
<PackageReference Include="xunit.core" Version="2.4.1" />
63-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
64-
<PrivateAssets>all</PrivateAssets>
65-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
66-
</PackageReference>
67-
<Compile Remove="**\*.*" />
68-
<Compile Include="GlobalSuppressions.cs" />
69-
<Compile Include="TestUtils\**\*.cs" />
68+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"/>
69+
<Compile Remove="Configuration\Extensions\System.Configuration\**\*.cs" />
70+
<Compile Remove="Configuration\Implementations\System.Configuration\**\*.cs" />
71+
<Compile Remove="Sinks\MSSqlServer\Platform\AzureManagedServiceAuthenticatorStubTests.cs" />
7072
<Compile Include="Configuration\Extensions\Hybrid\**\*.cs" />
7173
<Compile Include="Configuration\Implementations\Microsoft.Extensions.Configuration\**\*.cs" />
7274
<Compile Include="Configuration\Implementations\System.Configuration\**\*.cs" />

0 commit comments

Comments
 (0)