From 1ad8e46ab5b7125ac97af9461524a1e039ae38bd Mon Sep 17 00:00:00 2001 From: Kyle Ratti <kyleratti@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:39:53 -0400 Subject: [PATCH] deps: upgrade to NUnit 4 --- Base.Tests/Base.Tests.csproj | 8 ++++---- Base.Tests/Structures/MaybeExtensionTests.cs | 12 ++++++------ Base.Tests/Structures/NullableExtensionTests.cs | 14 +++++++++----- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Base.Tests/Base.Tests.csproj b/Base.Tests/Base.Tests.csproj index e3853c0..4a92390 100644 --- a/Base.Tests/Base.Tests.csproj +++ b/Base.Tests/Base.Tests.csproj @@ -10,10 +10,10 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" /> - <PackageReference Include="NUnit" Version="3.13.3" /> - <PackageReference Include="NUnit3TestAdapter" Version="4.3.1" /> - <PackageReference Include="coverlet.collector" Version="3.2.0"> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" /> + <PackageReference Include="NUnit" Version="4.1.0" /> + <PackageReference Include="NUnit3TestAdapter" Version="4.5.0" /> + <PackageReference Include="coverlet.collector" Version="6.0.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> diff --git a/Base.Tests/Structures/MaybeExtensionTests.cs b/Base.Tests/Structures/MaybeExtensionTests.cs index cf817d6..cc1814b 100644 --- a/Base.Tests/Structures/MaybeExtensionTests.cs +++ b/Base.Tests/Structures/MaybeExtensionTests.cs @@ -11,22 +11,22 @@ public class MaybeExtensionTests [Test] public void EnumerableFirstOrEmptyTests() { - Assert.AreEqual(Maybe.Empty<string>(), Array.Empty<string>().FirstOrEmpty()); - Assert.AreEqual(Maybe.Create<string>("banana"), new[] { "banana" }.FirstOrEmpty()); + Assert.That(Array.Empty<string>().FirstOrEmpty(), Is.EqualTo(Maybe.Empty<string>())); + Assert.That(new[] { "banana" }.FirstOrEmpty(), Is.EqualTo(Maybe.Create<string>("banana"))); } [Test] public void TestToMaybe() { - Assert.AreEqual(Maybe.Empty<int>(), Maybe.Empty<int>()); - Assert.AreNotEqual(Maybe.Create(293921), Maybe.Create(2)); + Assert.That(Maybe.Empty<int>(), Is.EqualTo(Maybe.Empty<int>())); + Assert.That(Maybe.Create(2), Is.Not.EqualTo(Maybe.Create(293921))); } [Test] public void MaybeNullableTests() { - Assert.IsNull(Maybe.Empty<int>().ToNullable()); - Assert.IsNull(Maybe.Create(0, evalIsEmpty: () => true).ToNullable()); + Assert.That(Maybe.Empty<int>().ToNullable(), Is.Null); + Assert.That(Maybe.Create(0, evalIsEmpty: () => true).ToNullable(), Is.Null); } [Test] diff --git a/Base.Tests/Structures/NullableExtensionTests.cs b/Base.Tests/Structures/NullableExtensionTests.cs index c681cf1..d18e9d4 100644 --- a/Base.Tests/Structures/NullableExtensionTests.cs +++ b/Base.Tests/Structures/NullableExtensionTests.cs @@ -7,12 +7,16 @@ namespace Base.Tests.Structures; public class NullableExtensionTests { [Test] - public void TestNullableStructOfNullToMaybe() => - Assert.AreEqual(Maybe.Empty<int>(), ((int?)null).ToMaybe()); - + public void TestNullableStructOfNullToMaybe() + { + Assert.That(((int?)null).ToMaybe(), Is.EqualTo(Maybe.Empty<int>())); + } + [Test] - public void TestNullableStructOfValueToMaybe() => - Assert.AreEqual(Maybe.Create(25), ((int?)25).ToMaybe()); + public void TestNullableStructOfValueToMaybe() + { + Assert.That(((int?)25).ToMaybe(), Is.EqualTo(Maybe.Create(25))); + } [Test] public void TestNullableReferenceOfNullAsMaybe()