Skip to content

Commit

Permalink
Fix compiler warning as error.
Browse files Browse the repository at this point in the history
Fix net8 system.text.json version update.
  • Loading branch information
chullybun committed Jul 10, 2024
1 parent 90009c4 commit 61aeb58
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<IsPackable>true</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/CoreEx/CoreEx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
<PackageReference Include="System.Memory.Data" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
Expand Down
22 changes: 16 additions & 6 deletions tests/CoreEx.Test/Framework/Mapping/MapperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,11 @@ public void MapWithSameType_Allowed()
{
var m = new Mapper();
var r = m.TryGetMapper<PersonA, PersonA>(out var sm);
Assert.That(r, Is.True);
Assert.That(sm, Is.Not.Null);
Assert.Multiple(() =>
{
Assert.That(r, Is.True);
Assert.That(sm, Is.Not.Null);
});

var p = new PersonA { Id = 88, Name = "blah" };
var d = sm!.Map(p);
Expand All @@ -925,11 +928,18 @@ public void MapWithSameType_Allowed()
[Test]
public void MapWithSameType_NotAllowed()
{
var m = new Mapper();
m.MapSameTypeWithSourceValue = false;
var m = new Mapper
{
MapSameTypeWithSourceValue = false
};

var r = m.TryGetMapper<PersonA, PersonA>(out var sm);
Assert.That(r, Is.False);
Assert.That(sm, Is.Null);

Assert.Multiple(() =>
{
Assert.That(r, Is.False);
Assert.That(sm, Is.Null);
});
}

public class PersonAMapper : Mapper<PersonA, PersonB>
Expand Down

0 comments on commit 61aeb58

Please sign in to comment.