Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add net481 tests #881

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public void WithoutDbUpdateExceptionDestructurerShouldLogDbValues()
logger.Error(new TestDbUpdateException("DbUpdate Error", entry), "Error");

var writtenJson = jsonWriter.ToString();
Assert.True(writtenJson.Contains(TestContext.UserIdIDoNotWantToSee, StringComparison.Ordinal) ||
writtenJson.Contains("\"Users\":\"threw System.TypeInitializationException", StringComparison.Ordinal));
Assert.True(writtenJson.Contains(TestContext.UserIdIDoNotWantToSee) ||
writtenJson.Contains("\"Users\":\"threw System.TypeInitializationException"));
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ public void CanDestructureFaultedTask()

Assert.Contains("Message", taskFirstLevelExceptionDictionary.Keys);
var message = Assert.IsType<string>(taskFirstLevelExceptionDictionary["Message"]);
#if NET481
Assert.Equal("One or more errors occurred.", message);
#else
Assert.Equal("One or more errors occurred. (INNER EXCEPTION MESSAGE)", message);
#endif

Assert.Contains("InnerExceptions", taskFirstLevelExceptionDictionary.Keys);
var innerExceptions = Assert.IsAssignableFrom<IReadOnlyCollection<object>>(taskFirstLevelExceptionDictionary["InnerExceptions"]);
Expand Down
7 changes: 6 additions & 1 deletion Tests/Serilog.Exceptions.Test/Serilog.Exceptions.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net481</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Label="Signing">
Expand All @@ -24,6 +24,11 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0" />
</ItemGroup>

<ItemGroup Label="Package References (NetStandard 2)" Condition="'$(TargetFramework)' == 'net481'">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
Expand Down
Loading