Skip to content

Commit

Permalink
tests on different frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
dombrovsky committed Jun 15, 2024
1 parent 03e4fb2 commit 3703638
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net4.8;net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -16,6 +16,10 @@
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Polyfill" Version="1.29.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 6 additions & 1 deletion StrongTypeIdGenerator.Tests/TypedIdentifierFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public void Equals_WhenSameId_ReturnsTrue()
Assert.That(sut1, Is.EqualTo(sut2).And.Not.SameAs(sut2));
}

#if NET7_0_OR_GREATER
[Test]
public void Equals_WhenSameIdButOneImplicitlyCasted_ReturnsTrue()
{
Expand All @@ -27,6 +28,7 @@ public void Equals_WhenSameIdButOneImplicitlyCasted_ReturnsTrue()

Assert.That(sut1, Is.EqualTo(sut2).And.Not.SameAs(sut2));
}
#endif

[Test]
public void GetHashCode_WhenSameId_ReturnsSameValue()
Expand Down Expand Up @@ -69,7 +71,10 @@ public void Equals_WhenBothNull_ReturnsTrue()
var sut1 = CreateSut(idNull);
var sut2 = CreateSut(idNull);

Assert.That(sut1, Is.EqualTo(sut2).And.EqualTo(TSut.Unspecified));
Assert.That(sut1, Is.EqualTo(sut2));
#if NET7_0_OR_GREATER
Assert.That(sut1, Is.EqualTo(TSut.Unspecified));
#endif
}

[Test]
Expand Down

0 comments on commit 3703638

Please sign in to comment.