diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index 4b5b04a7..a31201de 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -62,6 +62,12 @@ jobs:
- name: Pack Optional
run: dotnet pack ./src/*/*/Optional.csproj --no-restore -o ~/nuget -c Release
+ - name: Restore Optional.Tests.Old
+ run: dotnet restore ./src/*/*/Optional.Tests.Old.csproj
+
+ - name: Test Optional.Tests.Old
+ run: dotnet test ./src/*/*/Optional.Tests.Old.csproj --no-restore -c Release
+
- name: Restore Optional.Tests
run: dotnet restore ./src/*/*/Optional.Tests.csproj
diff --git a/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj b/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj
index 5ce498ab..f03cbb43 100644
--- a/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj
+++ b/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj
@@ -16,22 +16,19 @@
-
-
-
-
+
- runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
runtime; build; native; contentfiles; analyzers; buildtransitive
- all
+
+
+
+
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/AbsentStaticTestsRef.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/AbsentStaticTestsRef.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/AbsentStaticTestsRef.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/AbsentStaticTestsRef.cs
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/AbsentStaticTestsStruct.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/AbsentStaticTestsStruct.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/AbsentStaticTestsStruct.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/AbsentStaticTestsStruct.cs
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/AbsentStaticTestsStructNullable.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/AbsentStaticTestsStructNullable.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/AbsentStaticTestsStructNullable.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/AbsentStaticTestsStructNullable.cs
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.Comparison.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.Comparison.cs
similarity index 80%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.Comparison.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.Comparison.cs
index 5b9604a8..6e27311e 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.Comparison.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.Comparison.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -9,13 +8,13 @@ partial class AbsentStaticTestsBase
public void Comparison_Compare_OfAndDefault_ExpectTrue()
{
var actual = Absent.Compare(Absent.Of(), default(Absent));
- Assert.Zero(actual);
+ Assert.That(actual, Is.Zero);
}
[Test]
public void Comparison_Compare_OfAndNew_ExpectTrue()
{
var actual = Absent.Compare(new Absent(), default(Absent));
- Assert.Zero(actual);
+ Assert.That(actual, Is.Zero);
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.Equality.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.Equality.cs
similarity index 79%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.Equality.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.Equality.cs
index 66fc53eb..156acc3b 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.Equality.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.Equality.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -9,13 +8,13 @@ partial class AbsentStaticTestsBase
public void Equality_Equals_OfAndDefault_ExpectTrue()
{
var actual = Absent.Equals(Absent.Of(), default(Absent));
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Equality_Equals_OfAndNew_ExpectTrue()
{
var actual = Absent.Equals(Absent.Of(), new Absent());
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.Factory.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.Factory.cs
similarity index 57%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.Factory.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.Factory.cs
index 79ea2a27..3194b80d 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.Factory.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.Factory.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -8,18 +7,18 @@ partial class AbsentStaticTestsBase
[Test]
public void Factory_Of_ExpectEqualToDefault()
{
- Assert.AreEqual(default(Absent), Absent.Of());
+ Assert.That(Absent.Of(), Is.EqualTo(default(Absent)));
}
[Test]
public void Factory_Of_ExpectEqualToNew()
{
- Assert.AreEqual(new Absent(), Absent.Of());
+ Assert.That(Absent.Of(), Is.EqualTo(new Absent()));
}
[Test]
public void Factory_Of_ExpectEqualToValue()
{
- Assert.AreEqual(Absent.Value, Absent.Of());
+ Assert.That(Absent.Of(), Is.EqualTo(Absent.Value));
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Static.Tests/Base/AbsentStaticTestsBase.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Static.Tests/Base/AbsentStaticTestsBase.cs
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/AbsentTestsRef.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/AbsentTestsRef.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/AbsentTestsRef.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/AbsentTestsRef.cs
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/AbsentTestsStruct.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/AbsentTestsStruct.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/AbsentTestsStruct.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/AbsentTestsStruct.cs
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/AbsentTestsStructNullable.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/AbsentTestsStructNullable.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/AbsentTestsStructNullable.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/AbsentTestsStructNullable.cs
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Comparison.Static.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Comparison.Static.cs
similarity index 80%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Comparison.Static.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Comparison.Static.cs
index 236da134..bd1af416 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Comparison.Static.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Comparison.Static.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -9,69 +8,69 @@ partial class AbsentTestsBase
public void Comparison_Compare_NewAndDefault_ExpectZero()
{
var actual = Absent.Compare(new Absent(), default);
- Assert.Zero(actual);
+ Assert.That(actual, Is.Zero);
}
[Test]
public void Comparison_Compare_ValueAndDefault_ExpectZero()
{
var actual = Absent.Compare(Absent.Value, default);
- Assert.Zero(actual);
+ Assert.That(actual, Is.Zero);
}
[Test]
public void Comparison_LessThanOrEqualToOperator_NewAndDefault_ExpectTrue()
{
var actual = new Absent() <= default(Absent);
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Comparison_LessThanOrEqualToOperator_ValueAndDefault_ExpectTrue()
{
var actual = Absent.Value <= default(Absent);
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Comparison_GreaterThanOrEqualToOperator_NewAndDefault_ExpectTrue()
{
var actual = new Absent() >= default(Absent);
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Comparison_GreaterThanOrEqualToOperator_ValueAndDefault_ExpectTrue()
{
var actual = Absent.Value >= default(Absent);
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Comparison_LessThanOperator_NewAndDefault_ExpectFalse()
{
var actual = new Absent() < default(Absent);
- Assert.False(actual);
+ Assert.That(actual, Is.False);
}
[Test]
public void Comparison_LessThanOperator_ValueAndDefault_ExpectFalse()
{
var actual = Absent.Value < default(Absent);
- Assert.False(actual);
+ Assert.That(actual, Is.False);
}
[Test]
public void Comparison_GreaterThanOperator_NewAndDefault_ExpectFalse()
{
var actual = new Absent() > default(Absent);
- Assert.False(actual);
+ Assert.That(actual, Is.False);
}
[Test]
public void Comparison_GreaterThanOperator_ValueAndDefault_ExpectFalse()
{
var actual = Absent.Value > default(Absent);
- Assert.False(actual);
+ Assert.That(actual, Is.False);
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Comparison.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Comparison.cs
similarity index 79%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Comparison.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Comparison.cs
index 669c2d9a..96378b14 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Comparison.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Comparison.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -9,44 +8,44 @@ partial class AbsentTestsBase
public void Comparison_CompareTo_NewAndDefault_ExpectZero()
{
var actual = new Absent().CompareTo(default);
- Assert.Zero(actual);
+ Assert.That(actual, Is.Zero);
}
[Test]
public void Comparison_CompareTo_ValueAndDefault_ExpectZero()
{
var actual = Absent.Value.CompareTo(default);
- Assert.Zero(actual);
+ Assert.That(actual, Is.Zero);
}
[Test]
public void Comparison_CompareToObj_NewAndNull_ExpectOne()
{
var actual = new Absent().CompareTo(null);
- Assert.Positive(actual);
- Assert.AreEqual(1, actual);
+ Assert.That(actual, Is.Positive);
+ Assert.That(actual, Is.EqualTo(1));
}
[Test]
public void Comparison_CompareToObj_ValueAndNull_ExpectOne()
{
var actual = Absent.Value.CompareTo(null);
- Assert.Positive(actual);
- Assert.AreEqual(1, actual);
+ Assert.That(actual, Is.Positive);
+ Assert.That(actual, Is.EqualTo(1));
}
[Test]
public void Comparison_CompareToObj_NewAndDefault_ExpectZero()
{
var actual = new Absent().CompareTo((object?)default(Absent));
- Assert.Zero(actual);
+ Assert.That(actual, Is.Zero);
}
[Test]
public void Comparison_CompareToObj_ValueAndDefault_ExpectZero()
{
var actual = Absent.Value.CompareTo((object?)new Absent());
- Assert.Zero(actual);
+ Assert.That(actual, Is.Zero);
}
[Test]
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Equality.Static.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Equality.Static.cs
similarity index 80%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Equality.Static.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Equality.Static.cs
index cd6267c0..06a503f6 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Equality.Static.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Equality.Static.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -9,41 +8,41 @@ partial class AbsentTestsBase
public void Equality_Static_Equals_NewAndDefault_ExpectTrue()
{
var actual = Absent.Equals(new Absent(), default);
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Equality_Static_Equals_ValueAndDefault_ExpectTrue()
{
var actual = Absent.Equals(Absent.Value, default);
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Equality_Static_EqualityOperator_NewAndDefault_ExpectTrue()
{
var actual = new Absent() == default;
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Equality_Static_EqualityOperator_ValueAndDefault_ExpectTrue()
{
var actual = Absent.Value == default;
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Equality_Static_InequalityOperator_NewAndDefault_ExpectFalse()
{
var actual = new Absent() != default;
- Assert.False(actual);
+ Assert.That(actual, Is.False);
}
[Test]
public void Equality_Static_InequalityOperator_ValueAndDefault_ExpectFalse()
{
var actual = Absent.Value != default;
- Assert.False(actual);
+ Assert.That(actual, Is.False);
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Equality.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Equality.cs
similarity index 78%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Equality.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Equality.cs
index 0c3053b7..2dad954b 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Equality.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Equality.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -9,13 +8,13 @@ partial class AbsentTestsBase
public void Equality_Equals_NewAndDefault_ExpectTrue()
{
var actual = new Absent().Equals(default);
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
[Test]
public void Equality_Equals_ValueAndDefault_ExpectTrue()
{
var actual = Absent.Value.Equals(default);
- Assert.True(actual);
+ Assert.That(actual, Is.True);
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Factory.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Factory.cs
similarity index 56%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Factory.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Factory.cs
index d92da74a..f05f0638 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.Factory.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.Factory.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -8,12 +7,12 @@ partial class AbsentTestsBase
[Test]
public void Factory_New_ExpectDefault()
{
- Assert.AreEqual(default(Absent), new Absent());
+ Assert.That(new Absent(), Is.EqualTo(default(Absent)));
}
[Test]
public void Factory_Value_ExpectDefault()
{
- Assert.AreEqual(default(Absent), Absent.Value);
+ Assert.That(Absent.Value, Is.EqualTo(default(Absent)));
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.ToOptional.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.ToOptional.cs
similarity index 74%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.ToOptional.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.ToOptional.cs
index d683aab0..5b1f9a7f 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.ToOptional.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.ToOptional.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -10,14 +9,14 @@ public void ToOptionalExplicit_FromDefault_ExpectAbsent()
{
var optional = default(Absent).ToOptional();
- Assert.IsTrue(optional.IsAbsent);
+ Assert.That(optional.IsAbsent, Is.True);
}
[Test]
public void ToOptionalImplicit_FromDefault_ExpectAbsent()
{
Optional optional = default(Absent);
- Assert.IsTrue(optional.IsAbsent);
+ Assert.That(optional.IsAbsent, Is.True);
}
[Test]
@@ -25,14 +24,14 @@ public void ToOptionalExplicit_FromNew_ExpectAbsent()
{
var optional = new Absent().ToOptional();
- Assert.IsTrue(optional.IsAbsent);
+ Assert.That(optional.IsAbsent, Is.True);
}
[Test]
public void ToOptionalImplicit_FromNew_ExpectAbsent()
{
Optional optional = new Absent();
- Assert.IsTrue(optional.IsAbsent);
+ Assert.That(optional.IsAbsent, Is.True);
}
[Test]
@@ -40,13 +39,13 @@ public void ToOptionalExplicit_FromValue_ExpectAbsent()
{
var optional = Absent.Value.ToOptional();
- Assert.IsTrue(optional.IsAbsent);
+ Assert.That(optional.IsAbsent, Is.True);
}
[Test]
public void ToOptionalImplicit_FromValue_ExpectAbsent()
{
Optional optional = Absent.Value;
- Assert.IsTrue(optional.IsAbsent);
+ Assert.That(optional.IsAbsent, Is.True);
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.ToString.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.ToString.cs
similarity index 76%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.ToString.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.ToString.cs
index 37067b7b..6d6fc23e 100644
--- a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.ToString.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.ToString.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using System;
+using System;
namespace PrimeFuncPack.Core.Tests;
@@ -12,6 +11,6 @@ public void ToString_ExpectAbsentFormat()
var expected = string.Format("Absent<{0}>:()", typeof(T).Name);
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.cs b/src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Absent.Tests/Base/AbsentTestsBase.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Absent.Tests/Base/AbsentTestsBase.cs
diff --git a/src/core-taggeds-optional/Optional.Tests/Assembly.cs b/src/core-taggeds-optional/Optional.Tests.Old/Assembly.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Assembly.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Assembly.cs
diff --git a/src/core-taggeds-optional/Optional.Tests.Old/GlobalUsings.cs b/src/core-taggeds-optional/Optional.Tests.Old/GlobalUsings.cs
new file mode 100644
index 00000000..cefced49
--- /dev/null
+++ b/src/core-taggeds-optional/Optional.Tests.Old/GlobalUsings.cs
@@ -0,0 +1 @@
+global using NUnit.Framework;
\ No newline at end of file
diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNull.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNull.cs
similarity index 83%
rename from src/core-taggeds-optional/Optional.Tests/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNull.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNull.cs
index 6385c08c..4a5c0b03 100644
--- a/src/core-taggeds-optional/Optional.Tests/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNull.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNull.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using PrimeFuncPack.UnitTest;
+using PrimeFuncPack.UnitTest;
using System;
using static PrimeFuncPack.UnitTest.TestData;
@@ -13,7 +12,7 @@ public void FilterNotNull_Class_SourceValueIsNotNull_ExpectSource()
var source = Optional.Present(PlusFifteenIdRefType);
var actual = FilterNotNullOptionalExtensions.FilterNotNull(source);
- Assert.AreEqual(source, actual);
+ Assert.That(actual, Is.EqualTo(source));
}
[Test]
@@ -22,8 +21,8 @@ public void FilterNotNull_Struct_SourceValueIsNotNull_ExpectSource()
var source = Optional.Present(PlusFifteen);
var actual = FilterNotNullOptionalExtensions.FilterNotNull(source);
- Assert.True(actual.IsPresent);
- Assert.AreEqual(source.OrThrow()!.Value, actual.OrThrow());
+ Assert.That(actual.IsPresent, Is.True);
+ Assert.That(actual.OrThrow(), Is.EqualTo(source.OrThrow()!.Value));
}
[Test]
@@ -34,7 +33,7 @@ public void FilterNotNull_SourceValueIsNull_ExpectAbsent()
var actual = FilterNotNullOptionalExtensions.FilterNotNull(source);
var expected = Optional.Absent;
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
[Test]
@@ -46,7 +45,7 @@ public void FilterNotNull_SourceValueIsNotNullRefType_ExpectNotNullableRefTypePr
var actual = FilterNotNullOptionalExtensions.FilterNotNull(source);
var expected = Optional.Present(sourceValue);
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
[Test]
@@ -57,7 +56,7 @@ public void FilterNotNull_SourceValueIsNullRefType_ExpectNotNullableRefTypeAbsen
var actual = FilterNotNullOptionalExtensions.FilterNotNull(source);
var expected = Optional.Absent;
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
[Test]
@@ -69,7 +68,7 @@ public void FilterNotNull_SourceValueIsNotNullStructType_ExpectNotNullableStruct
var actual = FilterNotNullOptionalExtensions.FilterNotNull(source);
var expected = Optional.Present(sourceValue);
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
[Test]
@@ -80,6 +79,6 @@ public void FilterNotNull_SourceValueIsNullStructType_ExpectNotNullableStructTyp
var actual = FilterNotNullOptionalExtensions.FilterNotNull(source);
var expected = Optional.Absent;
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNullOrThrow.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNullOrThrow.cs
similarity index 86%
rename from src/core-taggeds-optional/Optional.Tests/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNullOrThrow.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNullOrThrow.cs
index dddd3ae9..c963868d 100644
--- a/src/core-taggeds-optional/Optional.Tests/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNullOrThrow.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.FilterNotNullOptionalExtensions.Tests/FilterNotNullOrThrow.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using PrimeFuncPack.UnitTest;
+using PrimeFuncPack.UnitTest;
using System;
using static PrimeFuncPack.UnitTest.TestData;
@@ -13,7 +12,7 @@ public void FilterNotNullOrThrow_SourceValueIsNotNull_ExpectSource()
var source = Optional.Present(ZeroIdRefType);
var actual = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source);
- Assert.AreEqual(source, actual);
+ Assert.That(actual, Is.EqualTo(source));
}
[Test]
@@ -29,7 +28,7 @@ public void FilterNotNullOrThrowWithFactory_ExceptionFactoryIsNull_ExpectArgumen
var source = Optional.Present(SomeTextStructType);
var ex = Assert.Throws(() => _ = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source, null!));
- Assert.AreEqual("exceptionFactory", ex?.ParamName);
+ Assert.That(ex!.ParamName, Is.EqualTo("exceptionFactory"));
}
[Test]
@@ -38,7 +37,7 @@ public void FilterNotNullOrThrowWithFactory_SourceValueIsNotNull_ExpectSource()
var source = Optional.Present(ZeroIdRefType);
var actual = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source, () => new SomeException());
- Assert.AreEqual(source, actual);
+ Assert.That(actual, Is.EqualTo(source));
}
[Test]
@@ -48,7 +47,7 @@ public void FilterNotNullOrThrowWithFactory_SourceValueIsNull_ExpectCreatedExcep
var resultException = new SomeException();
var ex = Assert.Throws(() => _ = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source, () => resultException));
- Assert.AreSame(resultException, ex);
+ Assert.That(ex, Is.SameAs(resultException));
}
[Test]
@@ -60,7 +59,7 @@ public void FilterNotNullOrThrow_SourceValueIsNotNullRefType_ExpectPresentNotNul
var actual = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source);
var expected = Optional.Present(sourceValue);
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
[Test]
@@ -76,7 +75,7 @@ public void FilterNotNullOrThrowWithFactory_RefTypeExceptionFactoryIsNull_Expect
var source = Optional.Present(PlusFifteenIdRefType);
var ex = Assert.Throws(() => _ = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source, null!));
- Assert.AreEqual("exceptionFactory", ex?.ParamName);
+ Assert.That(ex!.ParamName, Is.EqualTo("exceptionFactory"));
}
[Test]
@@ -88,7 +87,7 @@ public void FilterNotNullOrThrowWithFactory_SourceValueIsNotNullRefType_ExpectPr
var actual = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source, () => new SomeException());
var expected = Optional.Present(sourceValue);
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
[Test]
@@ -97,9 +96,9 @@ public void FilterNotNullOrThrowWithFactory_SourceValueIsNullRefType_ExpectCreat
var source = Optional.Present(null);
var createdException = new SomeException();
- var actualExcepton = Assert.Throws(
+ var actualException = Assert.Throws(
() => _ = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source, () => createdException));
- Assert.AreSame(createdException, actualExcepton);
+ Assert.That(actualException, Is.SameAs(createdException));
}
[Test]
@@ -111,7 +110,7 @@ public void FilterNotNullOrThrow_SourceValueIsNotNullStructType_ExpectPresentNot
var actual = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source);
var expected = Optional.Present(sourceValue);
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
[Test]
@@ -127,7 +126,7 @@ public void FilterNotNullOrThrowWithFactory_StructExceptionFactoryIsNull_ExpectA
var source = Optional.Present(null);
var ex = Assert.Throws(() => _ = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source, null!));
- Assert.AreEqual("exceptionFactory", ex?.ParamName);
+ Assert.That(ex!.ParamName, Is.EqualTo("exceptionFactory"));
}
[Test]
@@ -139,7 +138,7 @@ public void FilterNotNullOrThrowWithFactory_SourceValueIsNotNullStructType_Expec
var actual = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source, () => new SomeException());
var expected = Optional.Present(sourceValue);
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
[Test]
@@ -148,8 +147,8 @@ public void FilterNotNullOrThrowWithFactory_SourceValueIsNullStructType_ExpectCr
var source = Optional.Present(null);
var createdException = new SomeException();
- var actualExcepton = Assert.Throws(
+ var actualException = Assert.Throws(
() => _ = FilterNotNullOptionalExtensions.FilterNotNullOrThrow(source, () => createdException));
- Assert.AreSame(createdException, actualExcepton);
+ Assert.That(actualException, Is.SameAs(createdException));
}
}
diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.FilterNotNullOptionalExtensions.Tests/Tests.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.FilterNotNullOptionalExtensions.Tests/Tests.cs
similarity index 100%
rename from src/core-taggeds-optional/Optional.Tests/Obsolete.FilterNotNullOptionalExtensions.Tests/Tests.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.FilterNotNullOptionalExtensions.Tests/Tests.cs
diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Dictionary.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Dictionary.cs
similarity index 89%
rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Dictionary.cs
rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Dictionary.cs
index 1913e699..5d9358fc 100644
--- a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Dictionary.cs
+++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Dictionary.cs
@@ -1,5 +1,4 @@
-using NUnit.Framework;
-using PrimeFuncPack.UnitTest;
+using PrimeFuncPack.UnitTest;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -15,7 +14,7 @@ public void GetValueOrAbsent_DictionaryPairsAreNull_ExpectArgumentNullException(
IDictionary sourceDictionary = null!;
var ex = Assert.Throws(Test);
- Assert.AreEqual("pairs", ex?.ParamName);
+ Assert.That(ex!.ParamName, Is.EqualTo("pairs"));
void Test()
=>
@@ -33,7 +32,7 @@ public void GetValueOrAbsent_DictionaryPairsPairsTryGetValueReturnsFalse_ExpectA
var actual = OptionalLinqDictionariesExtensions.GetValueOrAbsent(sourceDictionary, PlusFifteenIdRefType);
var expected = Optional.Absent;
- Assert.AreEqual(expected, actual);
+ Assert.That(actual, Is.EqualTo(expected));
}
[Test]
@@ -50,6 +49,6 @@ public void GetValueOrAbsent_DictionaryPairsPairsTryGetValueReturnsTrue_ExpectPr
var actual = OptionalLinqDictionariesExtensions.GetValueOrAbsent(sourceDictionary, NullTextStructType);
var expected = Optional