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.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Pair.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Pair.cs similarity index 91% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Pair.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Pair.cs index dc555ae7..0d1eb710 100644 --- a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Pair.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.Pair.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_PairsAreNull_ExpectArgumentNullException() IEnumerable> sourcePairs = 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_PairsDoNotContainKey_ExpectAbsent() var actual = OptionalLinqDictionariesExtensions.GetValueOrAbsent(sourcePairs, PlusFifteen); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -53,7 +52,7 @@ public void GetValueOrAbsent_PairsContainOnlyOneKey_ExpectPresentKeyValue( var actual = OptionalLinqDictionariesExtensions.GetValueOrAbsent(sourcePairs, sourceKey); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [TestCase] @@ -68,7 +67,7 @@ public void GetValueOrAbsent_PairsContainOnlyOneKeyAndKeyIsNull_ExpectPresentKey var actual = OptionalLinqDictionariesExtensions.GetValueOrAbsent(sourcePairs, null); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -88,6 +87,6 @@ public void GetValueOrAbsent_PairsContainMoreThanOneKey_ExpectFirst() var expected2 = Optional.Present(expectedValue2); bool equalToAnExpected = actual.Equals(expected1) || actual.Equals(expected2); - Assert.True(equalToAnExpected); + Assert.That(equalToAnExpected); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.Public.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.Public.cs similarity index 89% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.Public.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.Public.cs index 9669b2c1..5e558dd5 100644 --- a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.Public.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.Public.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_PublicReadOnlyDictionaryPairsAreNull_ExpectArgument IReadOnlyDictionary sourceDictionary = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("dictionary", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("dictionary")); void Test() => @@ -35,7 +34,7 @@ public void GetValueOrAbsent_PublicReadOnlyDictionaryPairsTryGetValueReturnsFals var actual = OptionalLinqDictionariesExtensions.GetValueOrAbsent(sourceDictionary, MinusFifteen); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -56,6 +55,6 @@ public void GetValueOrAbsent_PublicReadOnlyDictionaryPairsTryGetValueReturnsTrue var actual = OptionalLinqDictionariesExtensions.GetValueOrAbsent(sourceDictionary, PlusFifteen); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs similarity index 90% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs index 24607276..96a98e68 100644 --- a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.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_ReadOnlyDictionaryPairsAreNull_ExpectArgumentNullEx IReadOnlyDictionary sourceDictionary = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("pairs", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("pairs")); void Test() => @@ -35,7 +34,7 @@ public void GetValueOrAbsent_ReadOnlyDictionaryPairsTryGetValueReturnsFalse_Expe var actual = OptionalLinqDictionariesExtensions.GetValueOrAbsent(sourceDictionary, MinusFifteen); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -56,6 +55,6 @@ public void GetValueOrAbsent_ReadOnlyDictionaryPairsTryGetValueReturnsTrue_Expec var actual = OptionalLinqDictionariesExtensions.GetValueOrAbsent(sourceDictionary, PlusFifteen); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/Tests.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/Tests.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqDictionariesExtensions.Tests/Tests.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqDictionariesExtensions.Tests/Tests.cs diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/ElementAtOrAbsent.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/ElementAtOrAbsent.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/ElementAtOrAbsent.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/ElementAtOrAbsent.cs index 71d8e083..886c6304 100644 --- a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/ElementAtOrAbsent.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/ElementAtOrAbsent.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByInt_ReadOnlyListSourceIsNull_ExpectArgumentNullEx int index = 1; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -37,7 +36,7 @@ public void ElementAtOrAbsentByInt_ReadOnlyListIndexIsInRange_ExpectPresentItem( var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -53,7 +52,7 @@ public void ElementAtOrAbsentByInt_ReadOnlyListIndexIsNotInRange_ExpectAbsent( var actual = OptionalLinqExtensions.ElementAtOrAbsent(source, index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -63,7 +62,7 @@ public void ElementAtOrAbsentByLong_ReadOnlyListSourceIsNull_ExpectArgumentNullE long index = 1; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -83,7 +82,7 @@ public void ElementAtOrAbsentByLong_ReadOnlyListIndexIsInRange_ExpectPresentItem var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -99,6 +98,6 @@ public void ElementAtOrAbsentByLong_ReadOnlyListIndexIsNotInRange_ExpectAbsent( var actual = OptionalLinqExtensions.ElementAtOrAbsent(source, index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/FirstOrAbsent.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/FirstOrAbsent.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/FirstOrAbsent.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/FirstOrAbsent.cs index 7dcb6ea7..8ddddd7b 100644 --- a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/FirstOrAbsent.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/FirstOrAbsent.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 FirstOrAbsent_ReadOnlyListSourceIsNull_ExpectArgumentNullException() IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void FirstOrAbsent_ReadOnlyListSourceIsEmpty_ExpectAbsent() var actual = OptionalLinqExtensions.FirstOrAbsent(source); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void FirstOrAbsent_ReadOnlyListSourceIsNotEmpty_ExpectPresentFirstItem( var actual = OptionalLinqExtensions.FirstOrAbsent(source); var expected = Optional.Present(firstItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void FirstOrAbsentByPredicate_ReadOnlyListSourceIsNull_ExpectArgumentNull IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -65,7 +64,7 @@ public void FirstOrAbsentByPredicate_ReadOnlyListPredicateIsNull_ExpectArgumentN var source = CreateReadOnlyList(SomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -80,7 +79,7 @@ public void FirstOrAbsentByPredicate_ReadOnlyListPredicateResultIsAlreadyFalse_E var actual = OptionalLinqExtensions.FirstOrAbsent(source, static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -103,7 +102,7 @@ public void FirstOrAbsentByPredicate_ReadOnlyListPredicateResultIsNotAlreadyFals var actual = OptionalLinqExtensions.FirstOrAbsent(source, Predicate); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); static bool Predicate(RefType? item) => diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/GetValueOrAbsent.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/GetValueOrAbsent.cs similarity index 89% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/GetValueOrAbsent.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/GetValueOrAbsent.cs index d706e412..29b7035c 100644 --- a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/GetValueOrAbsent.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/GetValueOrAbsent.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_ReadOnlyDictionaryPairsAreNull_ExpectArgumentNullEx IReadOnlyDictionary sourceDictionary = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("dictionary", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("dictionary")); void Test() => @@ -35,7 +34,7 @@ public void GetValueOrAbsent_ReadOnlyDictionaryPairsTryGetValueReturnsFalse_Expe var actual = OptionalLinqExtensions.GetValueOrAbsent(sourceDictionary, MinusFifteen); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -54,6 +53,6 @@ public void GetValueOrAbsent_ReadOnlyDictionaryPairsTryGetValueReturnsTrue_Expec var actual = OptionalLinqExtensions.GetValueOrAbsent(sourceDictionary, decimal.MinusOne); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/LastOrAbsent.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/LastOrAbsent.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/LastOrAbsent.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/LastOrAbsent.cs index 268b3e48..bd97736c 100644 --- a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/LastOrAbsent.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/LastOrAbsent.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 LastOrAbsent_ReadOnlyListSourceIsNull_ExpectArgumentNullException() IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void LastOrAbsent_ReadOnlyListSourceIsEmpty_ExpectAbsent() var actual = OptionalLinqExtensions.LastOrAbsent(source); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void LastOrAbsent_ReadOnlyListSourceIsNotEmpty_ExpectPresentLastItem( var actual = OptionalLinqExtensions.LastOrAbsent(source); var expected = Optional.Present(lastItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void LastOrAbsentByPredicate_ReadOnlyListSourceIsNull_ExpectArgumentNullE IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -65,7 +64,7 @@ public void LastOrAbsentByPredicate_ReadOnlyListPredicateIsNull_ExpectArgumentNu var source = CreateReadOnlyList(SomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -80,7 +79,7 @@ public void LastOrAbsentByPredicate_ReadOnlyListPredicateResultIsAlreadyFalse_Ex var actual = OptionalLinqExtensions.LastOrAbsent(source, static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -104,7 +103,7 @@ public void LastOrAbsentByPredicate_ReadOnlyListPredicateResultIsNotAlreadyFalse var actual = OptionalLinqExtensions.LastOrAbsent(source, Predicate); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); static bool Predicate(RefType? item) => diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/SingleOrAbsent.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/SingleOrAbsent.cs similarity index 89% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/SingleOrAbsent.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/SingleOrAbsent.cs index f3ded5fa..4761c2fe 100644 --- a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/SingleOrAbsent.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/SingleOrAbsent.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 SingleOrAbsent_ReadOnlyListSourceIsNull_ExpectArgumentNullException( IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void SingleOrAbsent_ReadOnlyListSourceIsEmpty_ExpectAbsent() var actual = OptionalLinqExtensions.SingleOrAbsent(source); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void SingleOrAbsent_ReadOnlyListSourceContainsOnlyOneElement_ExpectPresen var actual = OptionalLinqExtensions.SingleOrAbsent(source); var expected = Optional.Present(singleItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -63,7 +62,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListSourceIsNull_ExpectAr IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -77,7 +76,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListExceptionFactoryIsNul Func exceptionFactory = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("moreThanOneElementExceptionFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("moreThanOneElementExceptionFactory")); void Test() => @@ -92,7 +91,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListSourceIsEmpty_ExpectA var actual = OptionalLinqExtensions.SingleOrAbsent(source, CreateSomeException); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -105,7 +104,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListSourceContainsOnlyOne var actual = OptionalLinqExtensions.SingleOrAbsent(source, CreateSomeException); var expected = Optional.Present(singleItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -115,7 +114,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListSourceContainsMoreTha var createdException = new SomeException(); var ex = Assert.Throws(Test); - Assert.AreSame(createdException, ex); + Assert.That(ex, Is.SameAs(createdException)); void Test() => @@ -128,7 +127,7 @@ public void SingleOrAbsentByPredicate_ReadOnlyListSourceIsNull_ExpectArgumentNul IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -142,7 +141,7 @@ public void SingleOrAbsentByPredicate_ReadOnlyListPredicateIsNull_ExpectArgument Func predicate = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -157,7 +156,7 @@ public void SingleOrAbsentByPredicate_ReadOnlyListPredicateResultIsAlreadyFalse_ var actual = OptionalLinqExtensions.SingleOrAbsent(source, static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -174,7 +173,7 @@ public void SingleOrAbsentByPredicate_ReadOnlyListPredicateResultIsTrueOnlyOnce_ var actual = OptionalLinqExtensions.SingleOrAbsent(source, item => expectedText.Equals(item?.Text, StringComparison.InvariantCultureIgnoreCase)); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -212,7 +211,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListSourceIsNull_ExpectA IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -226,7 +225,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListPredicateIsNull_Expe Func predicate = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -239,7 +238,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListExceptionFactoryIsNu var source = CreateReadOnlyList(MinusFifteenIdRefType); var ex = Assert.Throws(Test); - Assert.AreEqual("moreThanOneMatchExceptionFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("moreThanOneMatchExceptionFactory")); void Test() => @@ -254,7 +253,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListPredicateResultIsAlr var actual = OptionalLinqExtensions.SingleOrAbsent(source, static _ => false, CreateSomeException); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -271,7 +270,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListPredicateResultIsTru var actual = OptionalLinqExtensions.SingleOrAbsent(source, item => expectedText.Equals(item?.Text, StringComparison.InvariantCultureIgnoreCase), CreateSomeException); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -295,7 +294,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListPredicateResultIsTru var createdException = new SomeException(); var actualException = Assert.Throws(Test); - Assert.AreSame(createdException, actualException); + Assert.That(actualException, Is.SameAs(createdException)); void Test() => diff --git a/src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/Tests.cs b/src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/Tests.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/Tests.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Obsolete.OptionalLinqExtensions.ReadOnly.Tests/Tests.cs diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Equality.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Equality.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Equality.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Equality.cs index 12f23778..0f536174 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Equality.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Equality.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; @@ -14,7 +13,7 @@ public void Equals_AIsAbsentAndBIsAbsent_ExpectTrue() var optionalB = Optional.Absent; var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -24,7 +23,7 @@ public void Equals_AIsDefaultAndBIsAbsent_ExpectTrue() var optionalB = Optional.Absent; var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -34,7 +33,7 @@ public void Equals_AIsAbsentAndBIsDefault_ExpectTrue() var optionalB = default(Optional); var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -46,7 +45,7 @@ public void Equals_AIsPresentAndBIsPresentAndValuesAreSame_ExpectTrue() var optionalB = Optional.Present(value); var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -56,7 +55,7 @@ public void Equals_AIsPresentAndBIsPresentAndValuesAreNull_ExpectTrue() var optionalB = Optional.Present(null); var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -66,7 +65,7 @@ public void Equals_AIsAbsentAndBIsPresent_ExpectFalse() var optionalB = Optional.Present(MinusFifteenIdRefType); var actual = Optional.Equals(optionalA, optionalB); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -76,7 +75,7 @@ public void Equals_AIsPresentAndBIsAbsent_ExpectFalse() var optionalB = Optional.Absent; var actual = Optional.Equals(optionalA, optionalB); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -86,6 +85,6 @@ public void Equals_AIsPresentAndBIsPresentAndValuesAreNotSame_ExpectFalse() var optionalB = Optional.Present(ZeroIdRefType); var actual = Optional.Equals(optionalA, optionalB); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.Bool.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.Bool.cs similarity index 75% rename from src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.Bool.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.Bool.cs index 243fe191..027dc30a 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.Bool.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.Bool.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using System; +using System; namespace PrimeFuncPack.Core.Tests; @@ -11,7 +10,7 @@ public void True_ExpectPresent() var actual = Optional.True(); var expected = Optional.Present(Unit.Value); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -20,6 +19,6 @@ public void False_ExpectAbsent() var actual = Optional.False(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.OrElse.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.OrElse.cs similarity index 82% rename from src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.OrElse.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.OrElse.cs index 8979c030..74ac69fa 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.OrElse.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.OrElse.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; @@ -15,7 +14,7 @@ public void PresentOrElse_ValueIsNotNull_ExpectPresent() var actual = Optional.PresentOrElse(sourceValue); var expected = Optional.Present(sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -24,7 +23,7 @@ public void PresentOrElse_ValueIsNull_ExpectAbsent() var actual = Optional.PresentOrElse(null!); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -35,7 +34,7 @@ public void PresentOrElseWithStructValue_ValueIsNotNull_ExpectPresent() var actual = Optional.PresentOrElse(sourceValue); var expected = Optional.Present(SomeTextStructType); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -46,7 +45,7 @@ public void PresentOrElseWithStructValue_NullableValueIsNotNull_ExpectPresent() var actual = Optional.PresentOrElse(sourceValue); var expected = Optional.Present(SomeTextStructType); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -55,6 +54,6 @@ public void PresentOrElseWithStructValue_ValueIsNull_ExpectAbsent() var actual = Optional.PresentOrElse(null!); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.OrThrow.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.OrThrow.cs similarity index 82% rename from src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.OrThrow.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.OrThrow.cs index 773d8764..a308cfaa 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.OrThrow.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.OrThrow.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; @@ -15,14 +14,14 @@ public void PresentOrThrow_ValueIsNotNull_ExpectPresent() var actual = Optional.PresentOrThrow(sourceValue); var expected = Optional.Present(sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] public void PresentOrThrow_ValueIsNull_ExpectArgumentNullException() { var ex = Assert.Throws(() => _ = Optional.PresentOrThrow(null!)); - Assert.AreEqual("value", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("value")); } [Test] @@ -33,7 +32,7 @@ public void PresentOrThrowWithStructValue_ValueIsNotNull_ExpectPresent() var actual = Optional.PresentOrThrow(sourceValue); var expected = Optional.Present(SomeTextStructType); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -44,13 +43,13 @@ public void PresentOrThrowWithStructValue_NullableValueIsNotNull_ExpectPresent() var actual = Optional.PresentOrThrow(sourceValue); var expected = Optional.Present(SomeTextStructType); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] public void PresentOrThrowWithStructValue_ValueIsNull_ExpectArgumentNullException() { var ex = Assert.Throws(() => _ = Optional.PresentOrThrow(null!)); - Assert.AreEqual("value", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("value")); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.cs similarity index 80% rename from src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.cs index ab4f15ce..2bb947ae 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.Factory.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.Factory.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using System; +using System; namespace PrimeFuncPack.Core.Tests; @@ -13,7 +12,7 @@ public void Present_ExpectPresent( var actual = Optional.Present(sourceValue); var expected = Optional.Present(sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -22,7 +21,7 @@ public void Absent_ExpectAbsent() var actual = Optional.Absent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -31,6 +30,6 @@ public void Absent_FromUnit_ExpectAbsent() var actual = Optional.Absent(Unit.Value); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/Optional.Static.Test/OptionalStaticTest.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Static.Test/OptionalStaticTest.cs diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/OptionalTest.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/OptionalTest.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/OptionalTest.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/OptionalTest.cs diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Bind.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Bind.cs similarity index 86% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Bind.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Bind.cs index 962dcc61..9db686a4 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Bind.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Bind.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; using static PrimeFuncPack.UnitTest.TestData; @@ -14,7 +13,7 @@ public void Bind_MapIsNull_ExpectArgumentNullException() var source = Optional.Present(PlusFifteenIdRefType); var ex = Assert.Throws(() => _ = source.Bind(null!)); - Assert.AreEqual("binder", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("binder")); } [Test] @@ -24,7 +23,7 @@ public void Bind_SourceIsAbsent_ExpectAbsent() var result = Optional.Present(PlusFifteenIdRefType); var actual = source.Bind(_ => result); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -37,7 +36,7 @@ public void Bind_SourceIsPresent_ExpectResultValue( var result = isResultPresent ? Optional.Present(PlusFifteenIdRefType) : Optional.Absent; var actual = source.Bind(_ => result); - Assert.AreEqual(result, actual); + Assert.That(actual, Is.EqualTo(result)); } [Test] @@ -46,7 +45,7 @@ public void BindAsync_MapAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("binderAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("binderAsync")); async Task TestAsync() => @@ -60,7 +59,7 @@ public async Task BindAsync_SourceIsAbsent_ExpectAbsent() var result = Optional.Present(PlusFifteenIdRefType); var actual = await source.BindAsync(_ => Task.FromResult(result)); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -73,7 +72,7 @@ public async Task BindAsync_SourceIsPresent_ExpectResultValue( var result = isResultPresent ? Optional.Present(SomeTextStructType) : Optional.Absent; var actual = await source.BindAsync(_ => Task.FromResult(result)); - Assert.AreEqual(result, actual); + Assert.That(actual, Is.EqualTo(result)); } [Test] @@ -82,7 +81,7 @@ public void BindValueAsync_MapAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(PlusFifteenIdRefType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("binderAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("binderAsync")); async Task TestAsync() => @@ -96,7 +95,7 @@ public async Task BindValueAsync_SourceIsAbsent_ExpectAbsent() var result = Optional.Present(SomeTextStructType); var actual = await source.BindValueAsync(_ => ValueTask.FromResult(result)); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -109,6 +108,6 @@ public async Task BindValueAsync_SourceIsPresent_ExpectResultValue( var result = isResultPresent ? Optional.Present(MinusFifteenIdRefType) : Optional.Absent; var actual = await source.BindValueAsync(_ => ValueTask.FromResult(result)); - Assert.AreEqual(result, actual); + Assert.That(actual, Is.EqualTo(result)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Equality.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Equality.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Equality.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Equality.cs index ffd4451e..4d39e15e 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Equality.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Equality.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; @@ -14,7 +13,7 @@ public void Equals_AIsAbsentAndBIsAbsent_ExpectTrue() var optionalB = Optional.Absent; var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -24,7 +23,7 @@ public void Equals_AIsDefaultAndBIsAbsent_ExpectTrue() var optionalB = Optional.Absent; var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -34,7 +33,7 @@ public void Equals_AIsAbsentAndBIsDefault_ExpectTrue() var optionalB = default(Optional); var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -46,7 +45,7 @@ public void Equals_AIsPresentAndBIsPresentAndValuesAreSame_ExpectTrue() var optionalB = Optional.Present(value); var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -56,7 +55,7 @@ public void Equals_AIsPresentAndBIsPresentAndValuesAreNull_ExpectTrue() var optionalB = Optional.Present(null); var actual = Optional.Equals(optionalA, optionalB); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -66,7 +65,7 @@ public void Equals_AIsAbsentAndBIsPresent_ExpectFalse() var optionalB = Optional.Present(MinusFifteenIdRefType); var actual = Optional.Equals(optionalA, optionalB); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -76,7 +75,7 @@ public void Equals_AIsPresentAndBIsAbsent_ExpectFalse() var optionalB = Optional.Absent; var actual = Optional.Equals(optionalA, optionalB); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -86,7 +85,7 @@ public void Equals_AIsPresentAndBIsPresentAndValuesAreNotSame_ExpectFalse() var optionalB = Optional.Present(ZeroIdRefType); var actual = Optional.Equals(optionalA, optionalB); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -96,7 +95,7 @@ public void EqualityOperator_AIsAbsentAndBIsAbsent_ExpectTrue() var optionalB = Optional.Absent; var actual = optionalA == optionalB; - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -108,7 +107,7 @@ public void EqualityOperator_AIsPresentAndBIsPresentAndValuesAreSame_ExpectTrue( var optionalB = Optional.Present(value); var actual = optionalA == optionalB; - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -118,7 +117,7 @@ public void EqualityOperator_AIsPresentAndBIsPresentAndValuesAreNull_ExpectTrue( var optionalB = Optional.Present(null); var actual = optionalA == optionalB; - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -128,7 +127,7 @@ public void EqualityOperator_AIsAbsentAndBIsPresent_ExpectFalse() var optionalB = Optional.Present(PlusFifteenIdRefType); var actual = optionalA == optionalB; - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -138,7 +137,7 @@ public void EqualityOperator_AIsPresentAndBIsAbsent_ExpectFalse() var optionalB = Optional.Absent; var actual = optionalA == optionalB; - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -148,7 +147,7 @@ public void EqualityOperator_AIsPresentAndBIsPresentAndValuesAreNotSame_ExpectFa var optionalB = Optional.Present(SomeTextStructType); var actual = optionalA == optionalB; - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -158,7 +157,7 @@ public void InequalityOperator_AIsAbsentAndBIsAbsent_ExpectFalse() var optionalB = Optional.Absent; var actual = optionalA != optionalB; - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -170,7 +169,7 @@ public void InequalityOperator_AIsPresentAndBIsPresentAndValuesAreSame_ExpectFal var optionalB = Optional.Present(value); var actual = optionalA != optionalB; - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -180,7 +179,7 @@ public void InequalityOperator_AIsPresentAndBIsPresentAndValuesAreNull_ExpectFal var optionalB = Optional.Present(null); var actual = optionalA != optionalB; - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -190,7 +189,7 @@ public void InequalityOperator_AIsAbsentAndBIsPresent_ExpectTrue() var optionalB = Optional.Present(SomeTextStructType); var actual = optionalA != optionalB; - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -200,7 +199,7 @@ public void InequalityOperator_AIsPresentAndBIsAbsent_ExpectTrue() var optionalB = Optional.Absent; var actual = optionalA != optionalB; - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -210,7 +209,7 @@ public void InequalityOperator_AIsPresentAndBIsPresentAndValuesAreNotSame_Expect var optionalB = Optional.Present(PlusFifteenIdRefType); var actual = optionalA != optionalB; - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -220,7 +219,7 @@ public void EqualsWithOther_SourceIsAbsentAndOtherIsAbsent_ExpectTrue() var other = Optional.Absent; var actual = source.Equals(other); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -232,7 +231,7 @@ public void EqualsWithOther_SourceIsPresentAndOtherIsPresentAndValuesAreSame_Exp var other = Optional.Present(value); var actual = source.Equals(other); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -242,7 +241,7 @@ public void EqualsWithOther_SourceIsPresentAndOtherIsPresentAndValuesAreNull_Exp var other = Optional.Present(null); var actual = source.Equals(other); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -252,7 +251,7 @@ public void EqualsWithOther_SourceIsAbsentAndOtherIsPresent_ExpectFalse() var other = Optional.Present(default); var actual = source.Equals(other); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -262,7 +261,7 @@ public void EqualsWithOther_SourceIsPresentAndOtherIsAbsent_ExpectFalse() var other = Optional.Absent; var actual = source.Equals(other); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -272,7 +271,7 @@ public void EqualsWithOther_SourceIsPresentAndOtherIsPresentAndValuesAreNotSame_ var other = Optional.Present(NullTextStructType); var actual = source.Equals(other); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -282,7 +281,7 @@ public void EqualsWithObject_SourceIsAbsentAndObjectIsAbsent_ExpectTrue() var obj = (object?)Optional.Absent; var actual = source.Equals(obj); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -294,7 +293,7 @@ public void EqualsWithObject_SourceIsPresentAndObjectIsPresentAndValuesAreSame_E var obj = (object?)Optional.Present(value); var actual = source.Equals(obj); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -304,7 +303,7 @@ public void EqualsWithObject_SourceIsPresentAndObjectIsPresentAndValuesAreNull_E var obj = (object?)Optional.Present(null); var actual = source.Equals(obj); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -314,7 +313,7 @@ public void EqualsWithObject_SourceIsPresentAndObjectIsOptionalOfSameRefNullable var obj = (object?)Optional.Present(PlusFifteenIdRefType); var actual = source.Equals(obj); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -324,7 +323,7 @@ public void EqualsWithObject_SourceIsAbsentAndObjectIsPresent_ExpectFalse() var obj = (object?)Optional.Present(default); var actual = source.Equals(obj); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -334,7 +333,7 @@ public void EqualsWithObject_SourceIsPresentAndObjectIsAbsent_ExpectFalse() var obj = (object?)Optional.Absent; var actual = source.Equals(obj); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -344,7 +343,7 @@ public void EqualsWithObject_SourceIsPresentAndObjectIsPresentAndValuesAreNotSam var obj = (object?)Optional.Present(NullTextStructType); var actual = source.Equals(obj); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -355,7 +354,7 @@ public void EqualsWithObject_SourceIsAbsentAndObjectIsNotOptional_ExpectFalse( var source = Optional.Absent; var actual = source.Equals(obj); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -366,7 +365,7 @@ public void EqualsWithObject_SourceIsPresentAndObjectIsNotOptional_ExpectFalse( var source = Optional.Present(MinusFifteenIdRefType); var actual = source.Equals(obj); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -376,7 +375,7 @@ public void EqualsWithObject_SourceIsAbsentAndObjectIsOtherOptional_ExpectFalse( var obj = Optional.Absent; var actual = source.Equals(obj); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -386,7 +385,7 @@ public void EqualsWithObject_SourceIsPresentAndObjectIsOtherOptional_ExpectFalse var obj = Optional.Present(MinusFifteenIdRefType); var actual = source.Equals(obj); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -396,7 +395,7 @@ public void EqualsWithObject_SourceIsPresentAndObjectIsOptionalOfSameStructNulla var obj = (object?)Optional.Present(SomeTextStructType); var actual = source.Equals(obj); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -408,7 +407,7 @@ public void GetHashCode_SourceIsAbsentAndOtherIsSameAbsent_ExpectSameValues() var sourceHashCode = source.GetHashCode(); var otherHashCode = other.GetHashCode(); - Assert.AreEqual(sourceHashCode, otherHashCode); + Assert.That(otherHashCode, Is.EqualTo(sourceHashCode)); } [Test] @@ -422,7 +421,7 @@ public void GetHashCode_SourceIsPresentAndOtherIsPresentAndValuesAreSame_ExpectS var sourceHashCode = source.GetHashCode(); var otherHashCode = other.GetHashCode(); - Assert.AreEqual(sourceHashCode, otherHashCode); + Assert.That(otherHashCode, Is.EqualTo(sourceHashCode)); } [Test] @@ -434,7 +433,7 @@ public void GetHashCode_SourceIsPresentAndOtherIsPresentAndValuesAreNull_ExpectS var sourceHashCode = source.GetHashCode(); var otherHashCode = other.GetHashCode(); - Assert.AreEqual(sourceHashCode, otherHashCode); + Assert.That(otherHashCode, Is.EqualTo(sourceHashCode)); } [Test] @@ -446,7 +445,7 @@ public void GetHashCode_SourceIsAbsentAndOtherIsPresent_ExpectNotSameValues() var sourceHashCode = source.GetHashCode(); var otherHashCode = other.GetHashCode(); - Assert.AreNotEqual(sourceHashCode, otherHashCode); + Assert.That(otherHashCode, Is.Not.EqualTo(sourceHashCode)); } [Test] @@ -458,7 +457,7 @@ public void GetHashCode_SourceIsPresentAndOtherIsAbsent_ExpectNotSameValues() var sourceHashCode = source.GetHashCode(); var otherHashCode = other.GetHashCode(); - Assert.AreNotEqual(sourceHashCode, otherHashCode); + Assert.That(otherHashCode, Is.Not.EqualTo(sourceHashCode)); } [Test] @@ -470,6 +469,6 @@ public void GetHashCode_SourceIsPresentAndOtherIsPresentAndValuesAreNotSame_Expe var sourceHashCode = source.GetHashCode(); var otherHashCode = other.GetHashCode(); - Assert.AreNotEqual(sourceHashCode, otherHashCode); + Assert.That(otherHashCode, Is.Not.EqualTo(sourceHashCode)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Absent.Constructor.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Absent.Constructor.cs similarity index 71% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Absent.Constructor.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Absent.Constructor.cs index 767402f1..c4f15f58 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Absent.Constructor.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Absent.Constructor.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; namespace PrimeFuncPack.Core.Tests; @@ -10,13 +9,13 @@ partial class OptionalTest public void Absent_Constructor_ExpectAbsentIsTrue() { var actual = new Optional(); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] public void Absent_Constructor_ExpectPresentIsFalse() { var actual = new Optional(); - Assert.False(actual.IsPresent); + Assert.That(actual.IsPresent, Is.False); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Absent.Default.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Absent.Default.cs similarity index 71% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Absent.Default.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Absent.Default.cs index cdfadf41..b784ed6e 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Absent.Default.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Absent.Default.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; namespace PrimeFuncPack.Core.Tests; @@ -10,13 +9,13 @@ partial class OptionalTest public void Absent_Default_ExpectAbsentIsTrue() { var actual = default(Optional); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] public void Absent_Default_ExpectPresentIsFalse() { var actual = default(Optional); - Assert.False(actual.IsPresent); + Assert.That(actual.IsPresent, Is.False); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Absent.Value.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Absent.Value.cs similarity index 71% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Absent.Value.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Absent.Value.cs index df79daaa..cd1f06ef 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Absent.Value.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Absent.Value.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; namespace PrimeFuncPack.Core.Tests; @@ -10,13 +9,13 @@ partial class OptionalTest public void Absent_Value_ExpectAbsentIsTrue() { var actual = Optional.Absent; - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] public void Absent_Value_ExpectPresentIsFalse() { var actual = Optional.Absent; - Assert.False(actual.IsPresent); + Assert.That(actual.IsPresent, Is.False); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Present.Constructor.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Present.Constructor.cs similarity index 77% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Present.Constructor.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Present.Constructor.cs index b6527607..f7d3c819 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Present.Constructor.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Present.Constructor.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; @@ -11,27 +10,27 @@ partial class OptionalTest public void Present_Constructor_SourceIsNull_ExpectPresentIsTrue() { var actual = new Optional(null); - Assert.True(actual.IsPresent); + Assert.That(actual.IsPresent, Is.True); } [Test] public void Present_Constructor_SourceIsNull_ExpectAbsentIsFalse() { var actual = new Optional(null); - Assert.False(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.False); } [Test] public void Present_Constructor_SourceIsNotNull_ExpectPresentIsTrue() { var actual = new Optional(PlusFifteenIdRefType); - Assert.True(actual.IsPresent); + Assert.That(actual.IsPresent, Is.True); } [Test] public void Present_Constructor_SourceIsNotNull_ExpectAbsentIsFalse() { var actual = new Optional(MinusFifteenIdRefType); - Assert.False(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.False); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Present.Explicit.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Present.Explicit.cs similarity index 77% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Present.Explicit.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Present.Explicit.cs index 81ad7abf..1561b279 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Present.Explicit.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Present.Explicit.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; @@ -11,27 +10,27 @@ partial class OptionalTest public void Present_Explicit_SourceIsNull_ExpectPresentIsTrue() { var actual = Optional.Present(null); - Assert.True(actual.IsPresent); + Assert.That(actual.IsPresent, Is.True); } [Test] public void Present_Explicit_SourceIsNull_ExpectAbsentIsFalse() { var actual = Optional.Present(null); - Assert.False(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.False); } [Test] public void Present_Explicit_SourceIsNotNull_ExpectPresentIsTrue() { var actual = Optional.Present(PlusFifteenIdRefType); - Assert.True(actual.IsPresent); + Assert.That(actual.IsPresent, Is.True); } [Test] public void Present_Explicit_SourceIsNotNull_ExpectAbsentIsFalse() { var actual = Optional.Present(MinusFifteenIdRefType); - Assert.False(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.False); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Present.Implicit.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Present.Implicit.cs similarity index 75% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Present.Implicit.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Present.Implicit.cs index 4566aaae..7e8387b2 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Factory.Present.Implicit.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Factory.Present.Implicit.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; @@ -11,27 +10,27 @@ partial class OptionalTest public void Present_Implicit_SourceIsNull_ExpectPresentIsTrue() { Optional actual = null; - Assert.True(actual.IsPresent); + Assert.That(actual.IsPresent, Is.True); } [Test] public void Present_Implicit_SourceIsNull_ExpectAbsentIsFalse() { Optional actual = null; - Assert.False(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.False); } [Test] public void Present_Implicit_SourceIsNotNull_ExpectPresentIsTrue() { Optional actual = PlusFifteenIdRefType; - Assert.True(actual.IsPresent); + Assert.That(actual.IsPresent, Is.True); } [Test] public void Present_Implicit_SourceIsNotNull_ExpectAbsentIsFalse() { Optional actual = MinusFifteenIdRefType; - Assert.False(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.False); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Filter.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Filter.cs similarity index 83% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Filter.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Filter.cs index 568c55ac..8a9d0fb3 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Filter.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Filter.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; using static PrimeFuncPack.UnitTest.TestData; @@ -14,7 +13,7 @@ public void Filter_PredicateIsNull_ExpectArgumentNullException() var source = Optional.Present(PlusFifteenIdRefType); var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -27,7 +26,7 @@ public void Filter_SourceIsAbsent_ExpectAbsent() var source = Optional.Absent; var actual = source.Filter(static _ => true); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -36,7 +35,7 @@ public void Filter_SourceIsPresentAndPredicateResultIsFalse_ExpectAbsent() var source = Optional.Present(SomeTextStructType); var actual = source.Filter(static _ => false); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -45,7 +44,7 @@ public void Filter_SourceIsPresentAndPredicateResultIsTrue_ExpectPresent() var source = Optional.Present(ZeroIdRefType); var actual = source.Filter(static _ => true); - Assert.True(actual.IsPresent); + Assert.That(actual.IsPresent, Is.True); } [Test] @@ -54,7 +53,7 @@ public void FilterAsync_PredicateAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("predicateAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicateAsync")); async Task TestAsync() => @@ -67,7 +66,7 @@ public async Task FilterAsync_SourceIsAbsent_ExpectAbsent() var source = Optional.Absent; var actual = await source.FilterAsync(static _ => Task.FromResult(true)); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -76,7 +75,7 @@ public async Task FilterAsync_SourceIsPresentAndPredicateResultIsFalse_ExpectAbs var source = Optional.Present(PlusFifteenIdRefType); var actual = await source.FilterAsync(static _ => Task.FromResult(false)); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -85,7 +84,7 @@ public async Task FilterAsync_SourceIsPresentAndPredicateResultIsTrue_ExpectPres var source = Optional.Present(null); var actual = await source.FilterAsync(static _ => Task.FromResult(true)); - Assert.True(actual.IsPresent); + Assert.That(actual.IsPresent, Is.True); } [Test] @@ -94,7 +93,7 @@ public void FilterValueAsync_PredicateAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(null); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("predicateAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicateAsync")); async Task TestAsync() => @@ -107,7 +106,7 @@ public async Task FilterValueAsync_SourceIsAbsent_ExpectAbsent() var source = Optional.Absent; var actual = await source.FilterValueAsync(static _ => ValueTask.FromResult(true)); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -116,7 +115,7 @@ public async Task FilterValueAsync_SourceIsPresentAndPredicateResultIsFalse_Expe var source = Optional.Present(SomeTextStructType); var actual = await source.FilterValueAsync(static _ => ValueTask.FromResult(false)); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -125,6 +124,6 @@ public async Task FilterValueAsync_SourceIsPresentAndPredicateResultIsTrue_Expec var source = Optional.Present(default); var actual = await source.FilterValueAsync(static _ => ValueTask.FromResult(true)); - Assert.True(actual.IsPresent); + Assert.That(actual.IsPresent, Is.True); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.FlatMap.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.FlatMap.cs similarity index 86% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.FlatMap.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.FlatMap.cs index b4ea1235..a9cdc2d6 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.FlatMap.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.FlatMap.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; using static PrimeFuncPack.UnitTest.TestData; @@ -14,7 +13,7 @@ public void FlatMap_MapIsNull_ExpectArgumentNullException() var source = Optional.Present(PlusFifteenIdRefType); var ex = Assert.Throws(Test); - Assert.AreEqual("map", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("map")); void Test() => @@ -28,7 +27,7 @@ public void FlatMap_SourceIsAbsent_ExpectAbsent() var result = Optional.Present(PlusFifteenIdRefType); var actual = source.FlatMap(_ => result); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -41,7 +40,7 @@ public void FlatMap_SourceIsPresent_ExpectResultValue( var result = isResultPresent ? Optional.Present(PlusFifteenIdRefType) : Optional.Absent; var actual = source.FlatMap(_ => result); - Assert.AreEqual(result, actual); + Assert.That(actual, Is.EqualTo(result)); } [Test] @@ -50,7 +49,7 @@ public void FlatMapAsync_MapAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("mapAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("mapAsync")); async Task TestAsync() => @@ -64,7 +63,7 @@ public async Task FlatMapAsync_SourceIsAbsent_ExpectAbsent() var result = Optional.Present(PlusFifteenIdRefType); var actual = await source.FlatMapAsync(_ => Task.FromResult(result)); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -77,7 +76,7 @@ public async Task FlatMapAsync_SourceIsPresent_ExpectResultValue( var result = isResultPresent ? Optional.Present(SomeTextStructType) : Optional.Absent; var actual = await source.FlatMapAsync(_ => Task.FromResult(result)); - Assert.AreEqual(result, actual); + Assert.That(actual, Is.EqualTo(result)); } [Test] @@ -86,7 +85,7 @@ public void FlatMapValueAsync_MapAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(PlusFifteenIdRefType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("mapAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("mapAsync")); async Task TestAsync() => @@ -100,7 +99,7 @@ public async Task FlatMapValueAsync_SourceIsAbsent_ExpectAbsent() var result = Optional.Present(SomeTextStructType); var actual = await source.FlatMapValueAsync(_ => ValueTask.FromResult(result)); - Assert.True(actual.IsAbsent); + Assert.That(actual.IsAbsent, Is.True); } [Test] @@ -113,6 +112,6 @@ public async Task FlatMapValueAsync_SourceIsPresent_ExpectResultValue( var result = isResultPresent ? Optional.Present(MinusFifteenIdRefType) : Optional.Absent; var actual = await source.FlatMapValueAsync(_ => ValueTask.FromResult(result)); - Assert.AreEqual(result, actual); + Assert.That(actual, Is.EqualTo(result)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Fold.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Fold.cs similarity index 85% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Fold.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Fold.cs index 31f63a07..55359404 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Fold.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Fold.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; using static PrimeFuncPack.UnitTest.TestData; @@ -14,7 +13,7 @@ public void Fold_MapIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.Throws(() => _ = source.Fold(null!, () => PlusFifteenIdRefType)); - Assert.AreEqual("map", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("map")); } [Test] @@ -23,7 +22,7 @@ public void Fold_OtherFactoryIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.Throws(() => _ = source.Fold(_ => PlusFifteenIdRefType, null!)); - Assert.AreEqual("otherFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("otherFactory")); } [Test] @@ -35,7 +34,7 @@ public void Fold_SourceIsPresent_ExpectMappedResult() var other = MinusFifteenIdRefType; var actual = source.Fold(_ => mapped, () => other); - Assert.AreSame(mapped, actual); + Assert.That(actual, Is.SameAs(mapped)); } [Test] @@ -47,7 +46,7 @@ public void Fold_SourceIsAbsent_ExpectOtherResult() var other = SomeTextStructType; var actual = source.Fold(_ => mapped, () => other); - Assert.AreEqual(mapped, actual); + Assert.That(actual, Is.EqualTo(mapped)); } [Test] @@ -58,7 +57,7 @@ public void FoldAsync_MapAsyncIsNull_ExpectArgumentNullException() var ex = Assert.ThrowsAsync( async () => _ = await source.FoldAsync(null!, () => Task.FromResult(MinusFifteenIdRefType))); - Assert.AreEqual("mapAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("mapAsync")); } [Test] @@ -69,7 +68,7 @@ public void FoldAsync_OtherFactoryAsyncIsNull_ExpectArgumentNullException() var ex = Assert.ThrowsAsync( async () => _ = await source.FoldAsync(_ => Task.FromResult(int.MaxValue), null!)); - Assert.AreEqual("otherFactoryAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("otherFactoryAsync")); } [Test] @@ -81,7 +80,7 @@ public async Task FoldAsync_SourceIsPresent_ExpectMappedResult() var other = SomeTextStructType; var actual = await source.FoldAsync(_ => Task.FromResult(mapped), () => Task.FromResult(other)); - Assert.AreEqual(mapped, actual); + Assert.That(actual, Is.EqualTo(mapped)); } [Test] @@ -93,7 +92,7 @@ public async Task FoldAsync_SourceIsAbsent_ExpectOtherResult() var other = SomeString; var actual = await source.FoldAsync(_ => Task.FromResult(mapped), () => Task.FromResult(other)); - Assert.AreEqual(mapped, actual); + Assert.That(actual, Is.SameAs(mapped)); } [Test] @@ -104,7 +103,7 @@ public void FoldValueAsync_MapAsyncIsNull_ExpectArgumentNullException() var ex = Assert.ThrowsAsync( async () => _ = await source.FoldValueAsync(null!, () => ValueTask.FromResult(MinusFifteenIdRefType))); - Assert.AreEqual("mapAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("mapAsync")); } [Test] @@ -115,7 +114,7 @@ public void FoldValueAsync_OtherFactoryAsyncIsNull_ExpectArgumentNullException() var ex = Assert.ThrowsAsync( async () => _ = await source.FoldValueAsync(_ => ValueTask.FromResult(int.MaxValue), null!)); - Assert.AreEqual("otherFactoryAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("otherFactoryAsync")); } [Test] @@ -127,7 +126,7 @@ public async Task FoldValueAsync_SourceIsPresent_ExpectMappedResult() var other = MinusFifteenIdRefType; var actual = await source.FoldValueAsync(_ => ValueTask.FromResult(mapped), () => ValueTask.FromResult(other)); - Assert.AreEqual(mapped, actual); + Assert.That(actual, Is.SameAs(mapped)); } [Test] @@ -139,6 +138,6 @@ public async Task FoldValueAsync_SourceIsAbsent_ExpectOtherResult() var other = MinusFifteenIdRefType; var actual = await source.FoldValueAsync(_ => ValueTask.FromResult(mapped), () => ValueTask.FromResult(other)); - Assert.AreEqual(mapped, actual); + Assert.That(actual, Is.SameAs(mapped)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Map.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Map.cs similarity index 85% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Map.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Map.cs index 1664e211..b8e9b136 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Map.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Map.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; using static PrimeFuncPack.UnitTest.TestData; @@ -14,7 +13,7 @@ public void Map_MapIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.Throws(() => _ = source.Map(null!)); - Assert.AreEqual("map", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("map")); } [Test] @@ -27,7 +26,7 @@ public void Map_SourceIsPresent_ExpectMappedPresentValue( var actual = source.Map(_ => mapped); var expected = Optional.Present(mapped); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -39,7 +38,7 @@ public void Map_SourceIsAbsent_ExpectAbsent() var actual = source.Map(_ => mapped); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -50,7 +49,7 @@ public void MapAsync_MapAsyncIsNull_ExpectArgumentNullException() var ex = Assert.ThrowsAsync( async () => _ = await source.MapAsync(null!)); - Assert.AreEqual("mapAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("mapAsync")); } [Test] @@ -62,7 +61,7 @@ public async Task MapAsync_SourceIsPresent_ExpectMappedPresentResult() var actual = await source.MapAsync(_ => Task.FromResult(mapped)); var expected = Optional.Present(mapped); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -74,7 +73,7 @@ public async Task MapAsync_SourceIsAbsent_ExpectAbsent() var actual = await source.MapAsync(_ => Task.FromResult(mapped)); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -83,7 +82,7 @@ public void MapValueAsync_MapAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.ThrowsAsync(async () => _ = await source.MapValueAsync(null!)); - Assert.AreEqual("mapAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("mapAsync")); } [Test] @@ -95,7 +94,7 @@ public async Task MapValueAsync_SourceIsPresent_ExpectMappedPresentResult() var actual = await source.MapValueAsync(_ => ValueTask.FromResult(mapped)); var expected = Optional.Present(mapped); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -107,6 +106,6 @@ public async Task MapValueAsync_SourceIsAbsent_ExpectAbsent() var actual = await source.MapValueAsync(_ => ValueTask.FromResult(mapped)); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.On.TUnit.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.On.TUnit.cs similarity index 92% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.On.TUnit.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.On.TUnit.cs index 87facd8c..8fab44f5 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.On.TUnit.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.On.TUnit.cs @@ -1,5 +1,4 @@ using Moq; -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; @@ -15,7 +14,7 @@ public void On_TUnit_OnPresentIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeString); var ex = Assert.Throws(Test); - Assert.AreEqual("onPresent", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onPresent")); void Test() => @@ -32,7 +31,7 @@ public void On_TUnit_OnElseIsNull_ExpectArgumentNullException() var source = Optional.Present(decimal.One); var ex = Assert.Throws(Test); - Assert.AreEqual("onElse", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onElse")); void Test() => @@ -74,7 +73,7 @@ public void On_TUnit_ExpectSource(bool isPresent) var source = isPresent ? new(SomeTextStructType) : Optional.Absent; var actual = source.On(OnPresent, OnElse); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static string OnPresent(StructType _) => @@ -91,7 +90,7 @@ public void OnAsync_TUnit_OnPresentAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(One); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onPresentAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onPresentAsync")); async Task TestAsync() => @@ -108,7 +107,7 @@ public void OnAsync_TUnit_OnElseAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(ZeroIdRefType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onElseAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onElseAsync")); async Task TestAsync() => @@ -150,7 +149,7 @@ public async Task OnAsync_TUnit_ExpectSource(bool isPresent) var source = isPresent ? new(int.MinValue) : Optional.Absent(); var actual = await source.OnAsync(OnPresentAsync, OnElseAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Task OnPresentAsync(int _) => @@ -167,7 +166,7 @@ public void OnValueAsync_TUnit_OnPresentAsyncIsNull_ExpectArgumentNullException( var source = Optional.Present(MinusFifteenIdRefType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onPresentAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onPresentAsync")); async Task TestAsync() => @@ -184,7 +183,7 @@ public void OnValueAsync_TUnit_OnElseAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextRecordStruct); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onElseAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onElseAsync")); async Task TestAsync() => @@ -226,7 +225,7 @@ public async Task OnValueAsync_TUnit_ExpectSource(bool isPresent) var source = isPresent ? new(PlusFifteen) : Optional.Absent(); var actual = await source.OnValueAsync(OnPresentAsync, OnElseAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static ValueTask OnPresentAsync(int _) => diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.On.Unit.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.On.Unit.cs similarity index 92% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.On.Unit.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.On.Unit.cs index c42def61..c9bcdb84 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.On.Unit.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.On.Unit.cs @@ -1,5 +1,4 @@ using Moq; -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; @@ -15,7 +14,7 @@ public void On_Unit_OnPresentIsNull_ExpectArgumentNullException() var source = Optional.Present(LowerSomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("onPresent", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onPresent")); void Test() => @@ -32,7 +31,7 @@ public void On_Unit_OnElseIsNull_ExpectArgumentNullException() var source = Optional.Present(UpperAnotherString); var ex = Assert.Throws(Test); - Assert.AreEqual("onElse", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onElse")); void Test() => @@ -74,7 +73,7 @@ public void On_Unit_ExpectSource(bool isPresent) var source = isPresent ? new(PlusFifteenIdRefType) : Optional.Absent; var actual = source.On(OnPresent, OnElse); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Unit OnPresent(RefType? _) => @@ -91,7 +90,7 @@ public void OnAsync_Unit_OnPresentAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(MinusFifteenIdSomeStringNameRecord); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onPresentAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onPresentAsync")); async Task TestAsync() => @@ -108,7 +107,7 @@ public void OnAsync_Unit_OnElseAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onElseAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onElseAsync")); async Task TestAsync() => @@ -150,7 +149,7 @@ public async Task OnAsync_Unit_ExpectSource(bool isPresent) var source = isPresent ? new(MinusFifteenIdNullNameRecord) : Optional.Absent(); var actual = await source.OnAsync(OnPresentAsync, OnElseAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Task OnPresentAsync(RecordType _) => @@ -167,7 +166,7 @@ public void OnValueAsync_Unit_OnPresentAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(long.MinValue); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onPresentAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onPresentAsync")); async Task TestAsync() => @@ -184,7 +183,7 @@ public void OnValueAsync_Unit_OnElseAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(LowerSomeString); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onElseAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onElseAsync")); async Task TestAsync() => @@ -226,7 +225,7 @@ public async Task OnValueAsync_Unit_ExpectSource(bool isPresent) var source = isPresent ? new(SomeString) : Optional.Absent(); var actual = await source.OnValueAsync(OnPresentAsync, OnElseAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static ValueTask OnPresentAsync(string _) => diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.On.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.On.cs similarity index 92% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.On.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.On.cs index 4ead5123..2c882186 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.On.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.On.cs @@ -1,5 +1,4 @@ using Moq; -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; @@ -15,7 +14,7 @@ public void On_OnPresentIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextRecordStruct); var ex = Assert.Throws(Test); - Assert.AreEqual("onPresent", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onPresent")); void Test() => @@ -32,7 +31,7 @@ public void On_OnElseIsNull_ExpectArgumentNullException() var source = Optional.Present(PlusFifteenIdRefType); var ex = Assert.Throws(Test); - Assert.AreEqual("onElse", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onElse")); void Test() => @@ -74,7 +73,7 @@ public void On_ExpectSource(bool isPresent) var source = isPresent ? new(PlusFifteenIdSomeStringNameRecord) : Optional.Absent; var actual = source.On(OnPresent, OnElse); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static void OnPresent(RecordType? _) { @@ -91,7 +90,7 @@ public void OnAsync_OnPresentAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(MinusFifteenIdRefType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onPresentAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onPresentAsync")); async Task TestAsync() => @@ -108,7 +107,7 @@ public void OnAsync_OnElseAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(long.MaxValue); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onElseAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onElseAsync")); async Task TestAsync() => @@ -150,7 +149,7 @@ public async Task OnAsync_ExpectSource(bool isPresent) var source = isPresent ? new(SomeTextStructType) : Optional.Absent(); var actual = await source.OnAsync(OnPresentAsync, OnElseAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Task OnPresentAsync(StructType _) => @@ -167,7 +166,7 @@ public void OnValueAsync_OnPresentAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(LowerSomeString); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onPresentAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onPresentAsync")); async Task TestAsync() => @@ -184,7 +183,7 @@ public void OnValueAsync_OnElseAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(ZeroIdRefType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("onElseAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("onElseAsync")); async Task TestAsync() => @@ -226,7 +225,7 @@ public async Task OnValueAsync_ExpectSource(bool isPresent) var source = isPresent ? new(MinusFifteenIdSomeStringNameRecord) : Optional.Absent(); var actual = await source.OnValueAsync(OnPresentAsync, OnElseAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static ValueTask OnPresentAsync(RecordType? _) => diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnAbsent.TUnit.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnAbsent.TUnit.cs similarity index 93% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnAbsent.TUnit.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnAbsent.TUnit.cs index d9cb1506..8f714f74 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnAbsent.TUnit.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnAbsent.TUnit.cs @@ -1,5 +1,4 @@ using Moq; -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; @@ -15,7 +14,7 @@ public void OnAbsent_TUnit_HandlerIsNull_ExpectArgumentNullException() var source = Optional.Present(PlusFifteenIdRefType); var ex = Assert.Throws(Test); - Assert.AreEqual("handler", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handler")); void Test() => @@ -53,7 +52,7 @@ public void OnAbsent_TUnit_ExpectSource(bool isPresent) var source = isPresent ? new(decimal.One) : Optional.Absent; var actual = source.OnAbsent(OnAbsent); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static string? OnAbsent() => @@ -66,7 +65,7 @@ public void OnAbsentAsync_TUnit_HandlerAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(MinusFifteenIdRefType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -104,7 +103,7 @@ public async Task OnAbsentAsync_TUnit_ExpectSource(bool isPresent) var source = isPresent ? new(ZeroIdRefType) : Optional.Absent(); var actual = await source.OnAbsentAsync(OnAbsentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Task OnAbsentAsync() => @@ -117,7 +116,7 @@ public void OnAbsentValueAsync_TUnit_HandlerAsyncIsNull_ExpectArgumentNullExcept var source = Optional.Present(decimal.MinusOne); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -155,7 +154,7 @@ public async Task OnAbsentValueAsync_TUnit_ExpectSource(bool isPresent) var source = isPresent ? new(new object()) : Optional.Absent(); var actual = await source.OnAbsentValueAsync(OnAbsentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static ValueTask OnAbsentAsync() => diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnAbsent.Unit.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnAbsent.Unit.cs similarity index 93% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnAbsent.Unit.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnAbsent.Unit.cs index 77fcb4df..7f07314a 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnAbsent.Unit.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnAbsent.Unit.cs @@ -1,5 +1,4 @@ using Moq; -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; @@ -17,7 +16,7 @@ public void OnAbsent_Unit_HandlerIsNull_ExpectArgumentNullException() var source = Optional.Present(LowerSomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("handler", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handler")); void Test() => @@ -55,7 +54,7 @@ public void OnAbsent_Unit_ExpectSource(bool isPresent) var source = isPresent ? new(PlusFifteenIdRefType) : Optional.Absent; var actual = source.OnAbsent(OnAbsent); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Unit OnAbsent() => @@ -70,7 +69,7 @@ public void OnAbsentAsync_Unit_HandlerAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextRecordStruct); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -108,7 +107,7 @@ public async Task OnAbsentAsync_Unit_ExpectSource(bool isPresent) var source = isPresent ? new(MinusFifteenIdSomeStringNameRecord) : Optional.Absent(); var actual = await source.OnAbsentAsync(OnAbsentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Task OnAbsentAsync() => @@ -123,7 +122,7 @@ public void OnAbsentValueAsync_Unit_HandlerAsyncIsNull_ExpectArgumentNullExcepti var source = Optional.Present(PlusFifteenIdRefType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -161,7 +160,7 @@ public async Task OnAbsentValueAsync_Unit_ExpectSource(bool isPresent) var source = isPresent ? new(SomeTextStructType) : Optional.Absent(); var actual = await source.OnAbsentValueAsync(OnAbsentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static ValueTask OnAbsentAsync() => diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnAbsent.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnAbsent.cs similarity index 93% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnAbsent.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnAbsent.cs index 5f64ed43..6fb08666 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnAbsent.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnAbsent.cs @@ -1,5 +1,4 @@ using Moq; -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; @@ -17,7 +16,7 @@ public void OnAbsent_HandlerIsNull_ExpectArgumentNullException() var source = Optional.Present(MinusOne); var ex = Assert.Throws(Test); - Assert.AreEqual("handler", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handler")); void Test() => @@ -55,7 +54,7 @@ public void OnAbsent_ExpectSource(bool isPresent) var source = isPresent ? new(SomeString) : Optional.Absent; var actual = source.OnAbsent(OnAbsent); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static void OnAbsent() { @@ -70,7 +69,7 @@ public void OnAbsentAsync_HandlerAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(LowerSomeTextStructType); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -108,7 +107,7 @@ public async Task OnAbsentAsync_ExpectSource(bool isPresent) var source = isPresent ? new(MinusFifteenIdNullNameRecord) : Optional.Absent(); var actual = await source.OnAbsentAsync(OnAbsentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Task OnAbsentAsync() => @@ -123,7 +122,7 @@ public void OnAbsentValueAsync_HandlerAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextRecordStruct); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -161,7 +160,7 @@ public async Task OnAbsentValueAsync_ExpectSource(bool isPresent) var source = isPresent ? new(decimal.One) : Optional.Absent(); var actual = await source.OnAbsentValueAsync(OnAbsentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static ValueTask OnAbsentAsync() => diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnPresent.TUnit.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnPresent.TUnit.cs similarity index 91% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnPresent.TUnit.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnPresent.TUnit.cs index ed21bb5d..bef220d3 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnPresent.TUnit.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnPresent.TUnit.cs @@ -1,5 +1,4 @@ using Moq; -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; @@ -15,7 +14,7 @@ public void OnPresent_TUnit_HandlerIsNull_ExpectArgumentNullException() var source = Optional.Present(One); var ex = Assert.Throws(Test); - Assert.AreEqual("handler", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handler")); void Test() => @@ -43,7 +42,7 @@ public void OnPresent_TUnit_ExpectSource(bool isPresent) var source = isPresent ? new(MinusFifteenIdRefType) : Optional.Absent; var actual = source.OnPresent(OnPresent); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static decimal OnPresent(RefType _) => @@ -56,7 +55,7 @@ public void OnPresentAsync_TUnit_HandlerAsyncIsNull_ExpectArgumentNullException( var source = Optional.Present(MinusFifteenIdSomeStringNameRecord); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -84,7 +83,7 @@ public async Task OnPresentAsync_TUnit_ExpectSource(bool isPresent) var source = isPresent ? new(MinusFifteenIdNullNameRecord) : Optional.Absent(); var actual = await source.OnPresentAsync(OnPresentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Task OnPresentAsync(RecordType? _) => @@ -97,7 +96,7 @@ public void OnPresentValueAsync_TUnit_HandlerAsyncIsNull_ExpectArgumentNullExcep var source = Optional.Present(SomeString); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -125,7 +124,7 @@ public async Task OnPresentValueAsync_TUnit_ExpectSource(bool isPresent) var source = isPresent ? new(SomeTextRecordStruct) : Optional.Absent(); var actual = await source.OnPresentValueAsync(OnPresentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static ValueTask OnPresentAsync(RecordStruct _) => diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnPresent.Unit.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnPresent.Unit.cs similarity index 92% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnPresent.Unit.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnPresent.Unit.cs index 5e493887..dd5b767c 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnPresent.Unit.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnPresent.Unit.cs @@ -1,5 +1,4 @@ using Moq; -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; @@ -17,7 +16,7 @@ public void OnPresent_Unit_HandlerIsNull_ExpectArgumentNullException() var source = Optional.Present(PlusFifteenIdRefType); var ex = Assert.Throws(Test); - Assert.AreEqual("handler", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handler")); void Test() => @@ -45,7 +44,7 @@ public void OnPresent_Unit_ExpectSource(bool isPresent) var source = isPresent ? new(PlusFifteenIdSomeStringNameRecord) : Optional.Absent; var actual = source.OnPresent(OnPresent); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Unit OnPresent(RecordType _) => @@ -60,7 +59,7 @@ public void OnPresentAsync_Unit_HandlerAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(decimal.MinusOne); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -88,7 +87,7 @@ public async Task OnPresentAsync_Unit_ExpectSource(bool isPresent) var source = isPresent ? new(SomeTextRecordStruct) : Optional.Absent(); var actual = await source.OnPresentAsync(OnPresentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Task OnPresentAsync(RecordStruct _) => @@ -103,7 +102,7 @@ public void OnPresentValueAsync_Unit_HandlerAsyncIsNull_ExpectArgumentNullExcept var source = Optional.Present(MinusFifteen); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -131,7 +130,7 @@ public async Task OnPresentValueAsync_Unit_ExpectSource(bool isPresent) var source = isPresent ? new(PlusFifteenIdRefType) : Optional.Absent(); var actual = await source.OnPresentValueAsync(OnPresentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static ValueTask OnPresentAsync(RefType? _) => diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnPresent.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnPresent.cs similarity index 91% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnPresent.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnPresent.cs index 0cc27c2c..232c5392 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OnPresent.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OnPresent.cs @@ -1,5 +1,4 @@ using Moq; -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; @@ -17,7 +16,7 @@ public void OnPresent_HandlerIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextRecordStruct); var ex = Assert.Throws(Test); - Assert.AreEqual("handler", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handler")); void Test() => @@ -45,7 +44,7 @@ public void OnPresent_ExpectSource(bool isPresent) var source = isPresent ? new(SomeTextStructType) : Optional.Absent; var actual = source.OnPresent(OnPresent); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static void OnPresent(StructType _) { @@ -60,7 +59,7 @@ public void OnPresentAsync_HandlerAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(long.MaxValue); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -88,7 +87,7 @@ public async Task OnPresentAsync_ExpectSource(bool isPresent) var source = isPresent ? new(SomeTextRecordStruct) : Optional.Absent(); var actual = await source.OnPresentAsync(OnPresentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static Task OnPresentAsync(RecordStruct? _) => @@ -103,7 +102,7 @@ public void OnPresentValueAsync_HandlerAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(MinusOne); var ex = Assert.ThrowsAsync(TestAsync); - Assert.AreEqual("handlerAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("handlerAsync")); async Task TestAsync() => @@ -131,7 +130,7 @@ public async Task OnPresentValueAsync_ExpectSource(bool isPresent) var source = isPresent ? new(ZeroIdRefType) : Optional.Absent(); var actual = await source.OnPresentValueAsync(OnPresentAsync); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); static ValueTask OnPresentAsync(RefType _) => diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Or.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Or.cs similarity index 86% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Or.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Or.cs index cf6be528..91d7bcca 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.Or.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.Or.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; using static PrimeFuncPack.UnitTest.TestData; @@ -14,7 +13,7 @@ public void Or_OtherFactoryIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.Throws(() => _ = source.Or(null!)); - Assert.AreEqual("otherFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("otherFactory")); } [Test] @@ -26,7 +25,7 @@ public void Or_SourceIsPresent_ExpectSourceValue( var other = Optional.Absent; var actual = source.Or(() => other); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); } [Test] @@ -39,7 +38,7 @@ public void Or_SourceIsAbsent_ExpectOtherValue( var other = isOtherPresent ? Optional.Present(MinusFifteenIdRefType) : default; var actual = source.Or(() => other); - Assert.AreEqual(other, actual); + Assert.That(actual, Is.EqualTo(other)); } [Test] @@ -48,7 +47,7 @@ public void OrAsync_OtherFactoryAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.ThrowsAsync(async () => _ = await source.OrAsync(null!)); - Assert.AreEqual("otherFactoryAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("otherFactoryAsync")); } [Test] @@ -60,7 +59,7 @@ public async Task OrAsync_SourceIsPresent_ExpectSourceValue( var other = Optional.Absent; var actual = await source.OrAsync(() => Task.FromResult(other)); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); } [Test] @@ -73,7 +72,7 @@ public async Task OrAsync_SourceIsAbsent_ExpectOtherValue( var other = isOtherPresent ? Optional.Present(MinusFifteenIdRefType) : default; var actual = await source.OrAsync(() => Task.FromResult(other)); - Assert.AreEqual(other, actual); + Assert.That(actual, Is.EqualTo(other)); } [Test] @@ -82,7 +81,7 @@ public void OrValueAsync_OtherFactoryAsyncIsNull_ExpectArgumentNullException() var source = Optional.Present(SomeTextStructType); var ex = Assert.ThrowsAsync(async () => _ = await source.OrValueAsync(null!)); - Assert.AreEqual("otherFactoryAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("otherFactoryAsync")); } [Test] @@ -94,7 +93,7 @@ public async Task OrValueAsync_SourceIsPresent_ExpectSourceValue( var other = Optional.Absent; var actual = await source.OrValueAsync(() => ValueTask.FromResult(other)); - Assert.AreEqual(source, actual); + Assert.That(actual, Is.EqualTo(source)); } [Test] @@ -107,6 +106,6 @@ public async Task OrValueAsync_SourceIsAbsent_ExpectOtherValue( var other = isOtherPresent ? Optional.Present(SomeString) : Optional.Absent; var actual = await source.OrValueAsync(() => ValueTask.FromResult(other)); - Assert.AreEqual(other, actual); + Assert.That(actual, Is.EqualTo(other)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OrDefault.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OrDefault.cs similarity index 80% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OrDefault.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OrDefault.cs index 1ffcfa2c..b6830d8a 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OrDefault.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OrDefault.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; namespace PrimeFuncPack.Core.Tests; @@ -14,7 +13,7 @@ public void OrDefault_SourceIsPresent_ExpectSourceValue( var source = Optional.Present(sourceValue); var actual = source.OrDefault(); - Assert.AreEqual(sourceValue, actual); + Assert.That(actual, Is.SameAs(sourceValue)); } [Test] @@ -23,7 +22,7 @@ public void OrDefault_SourceIsStructTypeAbsent_ExpectDefaultStructValue() var source = Optional.Absent; var actual = source.OrDefault(); - Assert.AreEqual(default(StructType), actual); + Assert.That(actual, Is.EqualTo(default(StructType))); } [Test] @@ -32,6 +31,6 @@ public void OrDefault_SourceIsRefTypeAbsent_ExpectNull() var source = Optional.Absent; var actual = source.OrDefault(); - Assert.Null(actual); + Assert.That(actual, Is.Null); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OrElse.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OrElse.cs similarity index 86% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OrElse.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OrElse.cs index 69949279..fc8ab0e0 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OrElse.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OrElse.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Threading.Tasks; using static PrimeFuncPack.UnitTest.TestData; @@ -20,7 +19,7 @@ public void OrElse_SourceIsPresent_ExpectSourceValue( var source = Optional.Present(sourceValue); var actual = source.OrElse(otherValue); - Assert.AreSame(sourceValue, actual); + Assert.That(actual, Is.SameAs(sourceValue)); } [Test] @@ -34,7 +33,7 @@ public void OrElse_SourceIsAbsent_ExpectOtherValue( var source = Optional.Absent; var actual = source.OrElse(otherValue); - Assert.AreEqual(otherValue, actual); + Assert.That(actual, Is.EqualTo(otherValue)); } [Test] @@ -44,7 +43,7 @@ public void OrElseWithFactory_OtherFactoryIsNull_ExpectArgumentNullExcepton() Func otherFactory = null!; var ex = Assert.Throws(() => _ = source.OrElse(otherFactory)); - Assert.AreEqual("otherFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("otherFactory")); } [Test] @@ -59,7 +58,7 @@ public void OrElseWithFactory_SourceIsPresent_ExpectSourceValue( var source = Optional.Present(sourceValue); var actual = source.OrElse(() => otherValue); - Assert.AreSame(sourceValue, actual); + Assert.That(actual, Is.SameAs(sourceValue)); } [Test] @@ -73,7 +72,7 @@ public void OrElseWithFactory_SourceIsAbsent_ExpectOtherValue( var source = Optional.Absent; var actual = source.OrElse(() => otherValue); - Assert.AreEqual(otherValue, actual); + Assert.That(actual, Is.EqualTo(otherValue)); } [Test] @@ -82,7 +81,7 @@ public void OrElseAsync_OtherFactoryAsyncIsNull_ExpectArgumentNullExcepton() var source = Optional.Present(PlusFifteen); var ex = Assert.ThrowsAsync(async () => _ = await source.OrElseAsync(null!)); - Assert.AreEqual("otherFactoryAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("otherFactoryAsync")); } [Test] @@ -97,7 +96,7 @@ public async Task OrElseAsync_SourceIsPresent_ExpectSourceValue( var source = Optional.Present(sourceValue); var actual = await source.OrElseAsync(() => Task.FromResult(otherValue)); - Assert.AreSame(sourceValue, actual); + Assert.That(actual, Is.SameAs(sourceValue)); } [Test] @@ -111,7 +110,7 @@ public async Task OrElseAsync_SourceIsAbsent_ExpectOtherValue( var source = Optional.Absent; var actual = await source.OrElseAsync(() => Task.FromResult(otherValue)); - Assert.AreEqual(otherValue, actual); + Assert.That(actual, Is.EqualTo(otherValue)); } [Test] @@ -120,7 +119,7 @@ public void OrElseValueAsync_OtherFactoryAsyncIsNull_ExpectArgumentNullExcepton( var source = Optional.Present(PlusFifteen); var ex = Assert.ThrowsAsync(async () => _ = await source.OrElseValueAsync(null!)); - Assert.AreEqual("otherFactoryAsync", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("otherFactoryAsync")); } [Test] @@ -135,7 +134,7 @@ public async Task OrElseValueAsync_SourceIsPresent_ExpectSourceValue( var source = Optional.Present(sourceValue); var actual = await source.OrElseValueAsync(() => ValueTask.FromResult(otherValue)); - Assert.AreSame(sourceValue, actual); + Assert.That(actual, Is.SameAs(sourceValue)); } [Test] @@ -149,6 +148,6 @@ public async Task OrElseValueAsync_SourceIsAbsent_ExpectOtherValue( var source = Optional.Absent; var actual = await source.OrElseValueAsync(() => ValueTask.FromResult(otherValue)); - Assert.AreEqual(otherValue, actual); + Assert.That(actual, Is.EqualTo(otherValue)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OrThrow.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OrThrow.cs similarity index 85% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OrThrow.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OrThrow.cs index ac3ff91f..3dd8b1dc 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.OrThrow.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.OrThrow.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; @@ -15,7 +14,7 @@ public void OrThrow_SourceIsPresent_ExpectSourceValue( var source = Optional.Present(sourceValue); var actual = source.OrThrow(); - Assert.AreEqual(sourceValue, actual); + Assert.That(actual, Is.SameAs(sourceValue)); } [Test] @@ -31,7 +30,7 @@ public void OrThrowWithFactory_ExceptionFactoryIsNull_ExpectArgumentNullExceptio var source = Optional.Present(SomeTextStructType); var ex = Assert.Throws(() => _ = source.OrThrow(null!)); - Assert.AreEqual("exceptionFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("exceptionFactory")); } [Test] @@ -42,7 +41,7 @@ public void OrThrowWithFactory_SourceIsPresent_ExpectSourceValue( var source = Optional.Present(sourceValue); var actual = source.OrThrow(() => new SomeException()); - Assert.AreEqual(sourceValue, actual); + Assert.That(actual, Is.SameAs(sourceValue)); } [Test] @@ -52,6 +51,6 @@ public void OrThrowWithFactory_SourceIsAbsent_ExpectFactoryResultException() var resultException = new SomeException(); var actualException = Assert.Throws(() => _ = source.OrThrow(() => resultException)); - Assert.AreSame(resultException, actualException); + Assert.That(actualException, Is.SameAs(resultException)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.ToString.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.ToString.cs similarity index 91% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.ToString.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.ToString.cs index eea208d5..a0cd11f3 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.ToString.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.ToString.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using System; +using System; using System.Collections.Generic; using System.Globalization; using static PrimeFuncPack.UnitTest.TestData; @@ -20,7 +19,7 @@ public void ToString_SourceIsAbsent() "Optional<{0}>:Absent:()", typeof(StubType).Name); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -36,7 +35,7 @@ public void ToString_SourceIsPresentAndValueIsNull() typeof(StubType).Name, string.Empty); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -53,7 +52,7 @@ public void ToString_SourceIsPresentAndValueToStringIsNull() typeof(StubType).Name, string.Empty); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -80,7 +79,7 @@ public void ToString_SourceIsPresent_ValueToString_Common( typeof(StubType).Name, sourceValueToStringResult); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -109,7 +108,7 @@ public void ToString_SourceIsPresent_Common( typeof(object).Name, sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -127,7 +126,7 @@ public void ToString_SourceIsPresent_DecimalPoint( typeof(decimal).Name, expectedDecimalSubstr); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } private static IEnumerable ToString_SourceIsPresent_DecimalPoint_TestCaseSource() diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.YieldFlattened.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.YieldFlattened.cs similarity index 77% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.YieldFlattened.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.YieldFlattened.cs index 42d99d3c..ead397b8 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.YieldFlattened.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.YieldFlattened.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Linq; @@ -15,10 +14,10 @@ public void YieldFlattened_SourceIsPresent_ExpectSingleValue( var source = Optional.Present(sourceValue); var actual = source.YieldFlattened(); - Assert.AreEqual(1, actual.Count()); + Assert.That(actual.Count(), Is.EqualTo(1)); + var actualValue = actual.Single(); - - Assert.AreEqual(sourceValue, actualValue); + Assert.That(actualValue, Is.SameAs(sourceValue)); } [Test] @@ -27,6 +26,6 @@ public void YieldFlattened_SourceIsAbsent_ExpectEmpty() var source = Optional.Absent; var actual = source.YieldFlattened(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } } diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.YieldSingleOrEmpty.cs b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.YieldSingleOrEmpty.cs similarity index 79% rename from src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.YieldSingleOrEmpty.cs rename to src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.YieldSingleOrEmpty.cs index c84c3c41..f7d2a1a1 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Test/Test.YieldSingleOrEmpty.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Test/Test.YieldSingleOrEmpty.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Linq; @@ -16,10 +15,10 @@ public void YieldSingleOrEmpty_SourceIsPresent_ExpectSingleValue( var source = Optional.Present(sourceValue); var actual = source.YieldSingleOrEmpty(); - Assert.AreEqual(1, actual.Count()); - var actualValue = actual.Single(); + Assert.That(actual.Count(), Is.EqualTo(1)); - Assert.AreEqual(sourceValue, actualValue); + var actualValue = actual.Single(); + Assert.That(actualValue, Is.SameAs(sourceValue)); } [Obsolete] @@ -29,6 +28,6 @@ public void YieldSingleOrEmpty_SourceIsAbsent_ExpectEmpty() var source = Optional.Absent; var actual = source.YieldSingleOrEmpty(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } } diff --git a/src/core-taggeds-optional/Optional.Tests.Old/Optional.Tests.Old.csproj b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Tests.Old.csproj new file mode 100644 index 00000000..405cf53f --- /dev/null +++ b/src/core-taggeds-optional/Optional.Tests.Old/Optional.Tests.Old.csproj @@ -0,0 +1,35 @@ + + + + net6.0;net7.0;net8.0 + latest + disable + enable + true + true + false + true + Andrei Sergeev, Pavel Moskovoy + Copyright © 2020-2024 Andrei Sergeev, Pavel Moskovoy + PrimeFuncPack.Core.Tests + PrimeFuncPack.Core.Optional.Tests.Old + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalExtensions.Tests/FilterNotNull.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalExtensions.Tests/FilterNotNull.cs similarity index 81% rename from src/core-taggeds-optional/Optional.Tests/OptionalExtensions.Tests/FilterNotNull.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalExtensions.Tests/FilterNotNull.cs index 50ae0e52..b7105a23 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalExtensions.Tests/FilterNotNull.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalExtensions.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 = source.FilterNotNull(); - 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 = source.FilterNotNull(); - 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 = source.FilterNotNull(); 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 = source.FilterNotNull(); 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 = source.FilterNotNull(); 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 = source.FilterNotNull(); 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 = source.FilterNotNull(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalExtensions.Tests/FilterNotNullOrThrow.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalExtensions.Tests/FilterNotNullOrThrow.cs similarity index 84% rename from src/core-taggeds-optional/Optional.Tests/OptionalExtensions.Tests/FilterNotNullOrThrow.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalExtensions.Tests/FilterNotNullOrThrow.cs index b882ff3c..59e119a0 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalExtensions.Tests/FilterNotNullOrThrow.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalExtensions.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 = source.FilterNotNullOrThrow(); - 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(() => _ = source.FilterNotNullOrThrow(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 = source.FilterNotNullOrThrow(() => 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(() => _ = source.FilterNotNullOrThrow(() => resultException)); - Assert.AreSame(resultException, ex); + Assert.That(ex, Is.SameAs(resultException)); } [Test] @@ -60,7 +59,7 @@ public void FilterNotNullOrThrow_SourceValueIsNotNullRefType_ExpectPresentNotNul var actual = source.FilterNotNullOrThrow(); 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(() => _ = source.FilterNotNullOrThrow(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 = source.FilterNotNullOrThrow(() => 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( () => _ = source.FilterNotNullOrThrow(() => createdException)); - Assert.AreSame(createdException, actualExcepton); + Assert.That(actualException, Is.SameAs(createdException)); } [Test] @@ -111,7 +110,7 @@ public void FilterNotNullOrThrow_SourceValueIsNotNullStructType_ExpectPresentNot var actual = source.FilterNotNullOrThrow(); 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(() => _ = source.FilterNotNullOrThrow(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 = source.FilterNotNullOrThrow(() => 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( () => _ = source.FilterNotNullOrThrow(() => createdException)); - Assert.AreSame(createdException, actualExcepton); + Assert.That(actualException, Is.SameAs(createdException)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalExtensions.Tests/Tests.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalExtensions.Tests/Tests.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/OptionalExtensions.Tests/Tests.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalExtensions.Tests/Tests.cs diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.FromEnd.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.FromEnd.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.FromEnd.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.FromEnd.cs index 788a58c6..fdfa203e 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.FromEnd.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.FromEnd.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByIndexFromEnd_CollectionSourceIsNull_ExpectArgumen var index = Index.FromEnd(1); var ex = Assert.Throws(() => _ = source.ElementAtOrAbsent(index)); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); } [Test] @@ -34,7 +33,7 @@ public void ElementAtOrAbsentByIndexFromEnd_CollectionIndexIsInRange_ExpectPrese var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -51,7 +50,7 @@ public void ElementAtOrAbsentByIndexFromEnd_CollectionIndexIsNotInRange_ExpectAb var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -68,6 +67,6 @@ public void ElementAtOrAbsentByIndexFromEnd_CollectionIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.cs index 9b2546e6..cc1d3d54 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Index.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByIndex_CollectionSourceIsNull_ExpectArgumentNullEx var index = Index.FromStart(1); var ex = Assert.Throws(() => _ = source.ElementAtOrAbsent(index)); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); } [Test] @@ -34,7 +33,7 @@ public void ElementAtOrAbsentByIndex_CollectionIndexIsInRange_ExpectPresentItem( var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -50,7 +49,7 @@ public void ElementAtOrAbsentByIndex_CollectionIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -67,6 +66,6 @@ public void ElementAtOrAbsentByIndex_CollectionIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int32.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int32.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int32.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int32.cs index 58a992b1..c8cdebb7 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int32.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int32.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByInt_CollectionSourceIsNull_ExpectArgumentNullExce int index = 1; var ex = Assert.Throws(() => _ = source.ElementAtOrAbsent(index)); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); } [Test] @@ -32,7 +31,7 @@ public void ElementAtOrAbsentByInt_CollectionIndexIsInRange_ExpectPresentItem( var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -48,7 +47,7 @@ public void ElementAtOrAbsentByInt_CollectionIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -65,6 +64,6 @@ public void ElementAtOrAbsentByInt_CollectionIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int64.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int64.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int64.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int64.cs index da8193de..d424d8ef 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int64.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.Enumerable.Int64.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByLong_CollectionSourceIsNull_ExpectArgumentNullExc long index = 1; var ex = Assert.Throws(() => _ = source.ElementAtOrAbsent(index)); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); } [Test] @@ -32,7 +31,7 @@ public void ElementAtOrAbsentByLong_CollectionIndexIsInRange_ExpectPresentItem( var expectedValue = source.ElementAt(checked((int)index)); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -48,7 +47,7 @@ public void ElementAtOrAbsentByLong_CollectionIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -65,6 +64,6 @@ public void ElementAtOrAbsentByLong_CollectionIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.FromEnd.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.FromEnd.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.FromEnd.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.FromEnd.cs index 7f7d2a02..614cccc2 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.FromEnd.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.FromEnd.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByIndexFromEnd_ListSourceIsNull_ExpectArgumentNullE var index = Index.FromEnd(1); var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -38,7 +37,7 @@ public void ElementAtOrAbsentByIndexFromEnd_ListIndexIsInRange_ExpectPresentItem var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -55,7 +54,7 @@ public void ElementAtOrAbsentByIndexFromEnd_ListIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -72,6 +71,6 @@ public void ElementAtOrAbsentByIndexFromEnd_ListIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.cs index 5dfcc496..394f9399 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Index.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByIndex_ListSourceIsNull_ExpectArgumentNullExceptio var index = Index.FromStart(1); var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -38,7 +37,7 @@ public void ElementAtOrAbsentByIndex_ListIndexIsInRange_ExpectPresentItem( var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -54,7 +53,7 @@ public void ElementAtOrAbsentByIndex_ListIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -71,6 +70,6 @@ public void ElementAtOrAbsentByIndex_ListIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int32.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int32.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int32.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int32.cs index 822052d4..8e804c82 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int32.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int32.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByInt_ListSourceIsNull_ExpectArgumentNullException( int index = 1; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -36,7 +35,7 @@ public void ElementAtOrAbsentByInt_ListIndexIsInRange_ExpectPresentItem( var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void ElementAtOrAbsentByInt_ListIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -69,6 +68,6 @@ public void ElementAtOrAbsentByInt_ListIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int64.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int64.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int64.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int64.cs index 4c5a3f9a..462ece29 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int64.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.List.Int64.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByLong_ListSourceIsNull_ExpectArgumentNullException long index = 1; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -36,7 +35,7 @@ public void ElementAtOrAbsentByLong_ListIndexIsInRange_ExpectPresentItem( var expectedValue = source.ElementAt(checked((int)index)); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void ElementAtOrAbsentByLong_ListIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -69,6 +68,6 @@ public void ElementAtOrAbsentByLong_ListIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.FromEnd.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.FromEnd.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.FromEnd.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.FromEnd.cs index d66f7c51..033e6735 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.FromEnd.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.FromEnd.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByIndexFromEnd_ReadOnlyListSourceIsNull_ExpectArgum var index = Index.FromEnd(1); var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -39,7 +38,7 @@ public void ElementAtOrAbsentByIndexFromEnd_ReadOnlyListIndexIsInRange_ExpectPre var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -56,7 +55,7 @@ public void ElementAtOrAbsentByIndexFromEnd_ReadOnlyListIndexIsNotInRange_Expect var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -73,6 +72,6 @@ public void ElementAtOrAbsentByIndexFromEnd_ReadOnlyListIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.cs index cc8cd74b..d2c4bc9c 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Index.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByIndex_ReadOnlyListSourceIsNull_ExpectArgumentNull var index = Index.FromStart(1); var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -39,7 +38,7 @@ public void ElementAtOrAbsentByIndex_ReadOnlyListIndexIsInRange_ExpectPresentIte var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -55,7 +54,7 @@ public void ElementAtOrAbsentByIndex_ReadOnlyListIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -72,6 +71,6 @@ public void ElementAtOrAbsentByIndex_ReadOnlyListIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int32.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int32.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int32.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int32.cs index 567adfb1..660bbbd8 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int32.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int32.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByInt_ReadOnlyListSourceIsNull_ExpectArgumentNullEx int index = 1; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -37,7 +36,7 @@ public void ElementAtOrAbsentByInt_ReadOnlyListIndexIsInRange_ExpectPresentItem( var expectedValue = source.ElementAt(index); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -53,7 +52,7 @@ public void ElementAtOrAbsentByInt_ReadOnlyListIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -70,6 +69,6 @@ public void ElementAtOrAbsentByInt_ReadOnlyListIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int64.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int64.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int64.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int64.cs index e947f2c0..06302d78 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int64.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/ElementAtOrAbsent.ReadOnlyList.Int64.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,7 @@ public void ElementAtOrAbsentByLong_ReadOnlyListSourceIsNull_ExpectArgumentNullE long index = 1; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -36,7 +35,7 @@ public void ElementAtOrAbsentByLong_ReadOnlyListIndexIsInRange_ExpectPresentItem var expectedValue = source.ElementAt(checked((int)index)); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void ElementAtOrAbsentByLong_ReadOnlyListIndexIsNotInRange_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -69,6 +68,6 @@ public void ElementAtOrAbsentByLong_ReadOnlyListIsEmpty_ExpectAbsent( var actual = source.ElementAtOrAbsent(index); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/FirstOrAbsent.Enumerable.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/FirstOrAbsent.Enumerable.cs similarity index 86% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/FirstOrAbsent.Enumerable.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/FirstOrAbsent.Enumerable.cs index b87457e9..67ef24f9 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/FirstOrAbsent.Enumerable.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/FirstOrAbsent.Enumerable.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 FirstOrAbsent_CollectionSourceIsNull_ExpectArgumentNullException() IEnumerable source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void FirstOrAbsent_CollectionSourceIsEmpty_ExpectAbsent() var actual = source.FirstOrAbsent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void FirstOrAbsent_CollectionSourceIsNotEmpty_ExpectPresentFirstItem( var actual = source.FirstOrAbsent(); var expected = Optional.Present(firstItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void FirstOrAbsentByPredicate_CollectionSourceIsNull_ExpectArgumentNullEx IEnumerable source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -65,7 +64,7 @@ public void FirstOrAbsentByPredicate_CollectionPredicateIsNull_ExpectArgumentNul var source = CreateCollection(SomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -80,7 +79,7 @@ public void FirstOrAbsentByPredicate_CollectionPredicateResultIsAlreadyFalse_Exp var actual = source.FirstOrAbsent(static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -102,6 +101,6 @@ public void FirstOrAbsentByPredicate_CollectionPredicateResultIsNotAlreadyFalse_ var actual = source.FirstOrAbsent(item => item?.Id == expectedId); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/FirstOrAbsent.List.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/FirstOrAbsent.List.cs similarity index 86% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/FirstOrAbsent.List.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/FirstOrAbsent.List.cs index 5abedaab..9e963218 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/FirstOrAbsent.List.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/FirstOrAbsent.List.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 FirstOrAbsent_ListSourceIsNull_ExpectArgumentNullException() IList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void FirstOrAbsent_ListSourceIsEmpty_ExpectAbsent() var actual = source.FirstOrAbsent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void FirstOrAbsent_ListSourceIsNotEmpty_ExpectPresentFirstItem( var actual = source.FirstOrAbsent(); var expected = Optional.Present(firstItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void FirstOrAbsentByPredicate_ListSourceIsNull_ExpectArgumentNullExceptio IList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -65,7 +64,7 @@ public void FirstOrAbsentByPredicate_ListPredicateIsNull_ExpectArgumentNullExcep var source = CreateList(SomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -80,7 +79,7 @@ public void FirstOrAbsentByPredicate_ListPredicateResultIsAlreadyFalse_ExpectAbs var actual = source.FirstOrAbsent(static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -103,7 +102,7 @@ public void FirstOrAbsentByPredicate_ListPredicateResultIsNotAlreadyFalse_Expect var actual = source.FirstOrAbsent(Predicate); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); static bool Predicate(RefType? item) => diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/FirstOrAbsent.ReadOnlyList.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/FirstOrAbsent.ReadOnlyList.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/FirstOrAbsent.ReadOnlyList.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/FirstOrAbsent.ReadOnlyList.cs index 10709075..81ff7ba3 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/FirstOrAbsent.ReadOnlyList.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/FirstOrAbsent.ReadOnlyList.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 FirstOrAbsent_ReadOnlyListSourceIsNull_ExpectArgumentNullException() IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void FirstOrAbsent_ReadOnlyListSourceIsEmpty_ExpectAbsent() var actual = source.FirstOrAbsent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void FirstOrAbsent_ReadOnlyListSourceIsNotEmpty_ExpectPresentFirstItem( var actual = source.FirstOrAbsent(); var expected = Optional.Present(firstItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void FirstOrAbsentByPredicate_ReadOnlyListSourceIsNull_ExpectArgumentNull IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -65,7 +64,7 @@ public void FirstOrAbsentByPredicate_ReadOnlyListPredicateIsNull_ExpectArgumentN var source = CreateReadOnlyList(SomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -80,7 +79,7 @@ public void FirstOrAbsentByPredicate_ReadOnlyListPredicateResultIsAlreadyFalse_E var actual = source.FirstOrAbsent(static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -103,7 +102,7 @@ public void FirstOrAbsentByPredicate_ReadOnlyListPredicateResultIsNotAlreadyFals var actual = source.FirstOrAbsent(Predicate); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); static bool Predicate(RefType? item) => diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/GetValueOrAbsent.Dictionary.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/GetValueOrAbsent.Dictionary.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/GetValueOrAbsent.Dictionary.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/GetValueOrAbsent.Dictionary.cs index 17816f81..55c7e295 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/GetValueOrAbsent.Dictionary.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.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 = sourceDictionary.GetValueOrAbsent(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 = sourceDictionary.GetValueOrAbsent(NullTextStructType); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/GetValueOrAbsent.Pairs.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/GetValueOrAbsent.Pairs.cs similarity index 90% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/GetValueOrAbsent.Pairs.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/GetValueOrAbsent.Pairs.cs index e1571f45..e86fb081 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/GetValueOrAbsent.Pairs.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/GetValueOrAbsent.Pairs.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_PairsAreNull_ExpectArgumentNullException() IEnumerable> sourcePairs = 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_PairsDoNotContainKey_ExpectAbsent() var actual = sourcePairs.GetValueOrAbsent(PlusFifteen); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -53,7 +52,7 @@ public void GetValueOrAbsent_PairsContainOnlyOneKey_ExpectPresentKeyValue( var actual = sourcePairs.GetValueOrAbsent(sourceKey); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [TestCase] @@ -68,7 +67,7 @@ public void GetValueOrAbsent_PairsContainOnlyOneKeyAndKeyIsNull_ExpectPresentKey var actual = sourcePairs.GetValueOrAbsent(null); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -88,6 +87,6 @@ public void GetValueOrAbsent_PairsContainMoreThanOneKey_ExpectFirst() var expected2 = Optional.Present(expectedValue2); bool equalToAnExpected = actual.Equals(expected1) || actual.Equals(expected2); - Assert.True(equalToAnExpected); + Assert.That(equalToAnExpected); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs similarity index 89% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs index e828cff9..04617caf 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/GetValueOrAbsent.ReadOnlyDictionary.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_ReadOnlyDictionaryPairsAreNull_ExpectArgumentNullEx IReadOnlyDictionary sourceDictionary = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("pairs", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("pairs")); void Test() => @@ -35,7 +34,7 @@ public void GetValueOrAbsent_ReadOnlyDictionaryPairsTryGetValueReturnsFalse_Expe var actual = sourceDictionary.GetValueOrAbsent(MinusFifteen); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -54,6 +53,6 @@ public void GetValueOrAbsent_ReadOnlyDictionaryPairsTryGetValueReturnsTrue_Expec var actual = sourceDictionary.GetValueOrAbsent(decimal.MinusOne); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/LastOrAbsent.Enumerable.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/LastOrAbsent.Enumerable.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/LastOrAbsent.Enumerable.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/LastOrAbsent.Enumerable.cs index 48c54dbe..8dda9cb7 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/LastOrAbsent.Enumerable.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/LastOrAbsent.Enumerable.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 LastOrAbsent_CollectionSourceIsNull_ExpectArgumentNullException() IEnumerable source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void LastOrAbsent_CollectionSourceIsEmpty_ExpectAbsent() var actual = source.LastOrAbsent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void LastOrAbsent_CollectionSourceIsNotEmpty_ExpectPresentLastItem( var actual = source.LastOrAbsent(); var expected = Optional.Present(lastItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void LastOrAbsentByPredicate_CollectionSourceIsNull_ExpectArgumentNullExc IEnumerable source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -65,7 +64,7 @@ public void LastOrAbsentByPredicate_CollectionPredicateIsNull_ExpectArgumentNull var source = CreateCollection(SomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -80,7 +79,7 @@ public void LastOrAbsentByPredicate_CollectionPredicateResultIsAlreadyFalse_Expe var actual = source.LastOrAbsent(static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -104,7 +103,7 @@ public void LastOrAbsentByPredicate_CollectionPredicateResultIsNotAlreadyFalse_E var actual = source.LastOrAbsent(Predicate); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); static bool Predicate(RefType? item) => diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/LastOrAbsent.List.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/LastOrAbsent.List.cs similarity index 86% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/LastOrAbsent.List.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/LastOrAbsent.List.cs index fa53917b..6f285657 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/LastOrAbsent.List.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/LastOrAbsent.List.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 LastOrAbsent_ListSourceIsNull_ExpectArgumentNullException() IList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void LastOrAbsent_ListSourceIsEmpty_ExpectAbsent() var actual = source.LastOrAbsent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void LastOrAbsent_ListSourceIsNotEmpty_ExpectPresentLastItem( var actual = source.LastOrAbsent(); var expected = Optional.Present(lastItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void LastOrAbsentByPredicate_ListSourceIsNull_ExpectArgumentNullException IList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -65,7 +64,7 @@ public void LastOrAbsentByPredicate_ListPredicateIsNull_ExpectArgumentNullExcept var source = CreateList(SomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -80,7 +79,7 @@ public void LastOrAbsentByPredicate_ListPredicateResultIsAlreadyFalse_ExpectAbse var actual = source.LastOrAbsent(static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -104,7 +103,7 @@ public void LastOrAbsentByPredicate_ListPredicateResultIsNotAlreadyFalse_ExpectP var actual = source.LastOrAbsent(Predicate); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); static bool Predicate(RefType? item) => diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/LastOrAbsent.ReadOnlyList.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/LastOrAbsent.ReadOnlyList.cs similarity index 87% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/LastOrAbsent.ReadOnlyList.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/LastOrAbsent.ReadOnlyList.cs index 8bfcd818..db12fd55 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/LastOrAbsent.ReadOnlyList.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/LastOrAbsent.ReadOnlyList.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 LastOrAbsent_ReadOnlyListSourceIsNull_ExpectArgumentNullException() IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void LastOrAbsent_ReadOnlyListSourceIsEmpty_ExpectAbsent() var actual = source.LastOrAbsent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void LastOrAbsent_ReadOnlyListSourceIsNotEmpty_ExpectPresentLastItem( var actual = source.LastOrAbsent(); var expected = Optional.Present(lastItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -52,7 +51,7 @@ public void LastOrAbsentByPredicate_ReadOnlyListSourceIsNull_ExpectArgumentNullE IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -65,7 +64,7 @@ public void LastOrAbsentByPredicate_ReadOnlyListPredicateIsNull_ExpectArgumentNu var source = CreateReadOnlyList(SomeTextStructType); var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -80,7 +79,7 @@ public void LastOrAbsentByPredicate_ReadOnlyListPredicateResultIsAlreadyFalse_Ex var actual = source.LastOrAbsent(static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -104,7 +103,7 @@ public void LastOrAbsentByPredicate_ReadOnlyListPredicateResultIsNotAlreadyFalse var actual = source.LastOrAbsent(Predicate); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); static bool Predicate(RefType? item) => diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/SingleOrAbsent.Enumerable.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/SingleOrAbsent.Enumerable.cs similarity index 89% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/SingleOrAbsent.Enumerable.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/SingleOrAbsent.Enumerable.cs index 9e554a49..de1147c2 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/SingleOrAbsent.Enumerable.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/SingleOrAbsent.Enumerable.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 SingleOrAbsent_CollectionSourceIsNull_ExpectArgumentNullException() IEnumerable source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void SingleOrAbsent_CollectionSourceIsEmpty_ExpectAbsent() var actual = source.SingleOrAbsent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void SingleOrAbsent_CollectionSourceContainsOnlyOneElement_ExpectPresentS var actual = source.SingleOrAbsent(); var expected = Optional.Present(singleItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -63,7 +62,7 @@ public void SingleOrAbsentWithExceptionFactory_CollectionSourceIsNull_ExpectArgu IEnumerable source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -77,7 +76,7 @@ public void SingleOrAbsentWithExceptionFactory_CollectionExceptionFactoryIsNull_ Func exceptionFactory = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("moreThanOneElementExceptionFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("moreThanOneElementExceptionFactory")); void Test() => @@ -92,7 +91,7 @@ public void SingleOrAbsentWithExceptionFactory_CollectionSourceIsEmpty_ExpectAbs var actual = source.SingleOrAbsent(CreateSomeException); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -105,7 +104,7 @@ public void SingleOrAbsentWithExceptionFactory_CollectionSourceContainsOnlyOneEl var actual = source.SingleOrAbsent(CreateSomeException); var expected = Optional.Present(singleItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -115,7 +114,7 @@ public void SingleOrAbsentWithExceptionFactory_CollectionSourceContainsMoreThanO var createdException = new SomeException(); var ex = Assert.Throws(Test); - Assert.AreSame(createdException, ex); + Assert.That(ex, Is.SameAs(createdException)); void Test() => @@ -128,7 +127,7 @@ public void SingleOrAbsentByPredicate_CollectionSourceIsNull_ExpectArgumentNullE IEnumerable source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -142,7 +141,7 @@ public void SingleOrAbsentByPredicate_CollectionPredicateIsNull_ExpectArgumentNu Func predicate = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -157,7 +156,7 @@ public void SingleOrAbsentByPredicate_CollectionPredicateResultIsAlreadyFalse_Ex var actual = source.SingleOrAbsent(static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -174,7 +173,7 @@ public void SingleOrAbsentByPredicate_CollectionPredicateResultIsTrueOnlyOnce_Ex var actual = source.SingleOrAbsent(item => expectedText.Equals(item?.Text, StringComparison.InvariantCultureIgnoreCase)); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -212,7 +211,7 @@ public void SingleOrAbsentByPredicateAndFactory_CollectionSourceIsNull_ExpectArg IEnumerable source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -230,7 +229,7 @@ public void SingleOrAbsentByPredicateAndFactory_CollectionPredicateIsNull_Expect Func predicate = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -243,7 +242,7 @@ public void SingleOrAbsentByPredicateAndFactory_CollectionExceptionFactoryIsNull var source = CreateCollection(MinusFifteenIdRefType); var ex = Assert.Throws(Test); - Assert.AreEqual("moreThanOneMatchExceptionFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("moreThanOneMatchExceptionFactory")); void Test() => @@ -262,7 +261,7 @@ public void SingleOrAbsentByPredicateAndFactory_CollectionPredicateResultIsAlrea var actual = source.SingleOrAbsent(static _ => false, CreateSomeException); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -281,7 +280,7 @@ public void SingleOrAbsentByPredicateAndFactory_CollectionPredicateResultIsTrueO CreateSomeException); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -305,7 +304,7 @@ public void SingleOrAbsentByPredicateAndFactory_CollectionPredicateResultIsTrueM var createdException = new SomeException(); var actualException = Assert.Throws(Test); - Assert.AreSame(createdException, actualException); + Assert.That(actualException, Is.SameAs(createdException)); void Test() => diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/SingleOrAbsent.List.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/SingleOrAbsent.List.cs similarity index 88% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/SingleOrAbsent.List.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/SingleOrAbsent.List.cs index 795fee40..273f999e 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/SingleOrAbsent.List.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/SingleOrAbsent.List.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 SingleOrAbsent_ListSourceIsNull_ExpectArgumentNullException() IList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void SingleOrAbsent_ListSourceIsEmpty_ExpectAbsent() var actual = source.SingleOrAbsent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void SingleOrAbsent_ListSourceContainsOnlyOneElement_ExpectPresentSingleE var actual = source.SingleOrAbsent(); var expected = Optional.Present(singleItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -63,7 +62,7 @@ public void SingleOrAbsentWithExceptionFactory_ListSourceIsNull_ExpectArgumentNu IList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -77,7 +76,7 @@ public void SingleOrAbsentWithExceptionFactory_ListExceptionFactoryIsNull_Expect Func exceptionFactory = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("moreThanOneElementExceptionFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("moreThanOneElementExceptionFactory")); void Test() => @@ -92,7 +91,7 @@ public void SingleOrAbsentWithExceptionFactory_ListSourceIsEmpty_ExpectAbsent() var actual = source.SingleOrAbsent(CreateSomeException); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -105,7 +104,7 @@ public void SingleOrAbsentWithExceptionFactory_ListSourceContainsOnlyOneElement_ var actual = source.SingleOrAbsent(CreateSomeException); var expected = Optional.Present(singleItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -115,7 +114,7 @@ public void SingleOrAbsentWithExceptionFactory_ListSourceContainsMoreThanOneElem var createdException = new SomeException(); var ex = Assert.Throws(Test); - Assert.AreSame(createdException, ex); + Assert.That(ex, Is.SameAs(createdException)); void Test() => @@ -128,7 +127,7 @@ public void SingleOrAbsentByPredicate_ListSourceIsNull_ExpectArgumentNullExcepti IList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -142,7 +141,7 @@ public void SingleOrAbsentByPredicate_ListPredicateIsNull_ExpectArgumentNullExce Func predicate = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -157,7 +156,7 @@ public void SingleOrAbsentByPredicate_ListPredicateResultIsAlreadyFalse_ExpectAb var actual = source.SingleOrAbsent(static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -174,7 +173,7 @@ public void SingleOrAbsentByPredicate_ListPredicateResultIsTrueOnlyOnce_ExpectPr var actual = source.SingleOrAbsent(item => expectedText.Equals(item?.Text, StringComparison.InvariantCultureIgnoreCase)); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -212,7 +211,7 @@ public void SingleOrAbsentByPredicateAndFactory_ListSourceIsNull_ExpectArgumentN IList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -226,7 +225,7 @@ public void SingleOrAbsentByPredicateAndFactory_ListPredicateIsNull_ExpectArgume Func predicate = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -239,7 +238,7 @@ public void SingleOrAbsentByPredicateAndFactory_ListExceptionFactoryIsNull_Expec var source = CreateList(MinusFifteenIdRefType); var ex = Assert.Throws(Test); - Assert.AreEqual("moreThanOneMatchExceptionFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("moreThanOneMatchExceptionFactory")); void Test() => @@ -254,7 +253,7 @@ public void SingleOrAbsentByPredicateAndFactory_ListPredicateResultIsAlreadyFals var actual = source.SingleOrAbsent(static _ => false, CreateSomeException); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -272,7 +271,7 @@ public void SingleOrAbsentByPredicateAndFactory_ListPredicateResultIsTrueOnlyOnc var actual = source.SingleOrAbsent(Predicate, CreateSomeException); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); static bool Predicate(StructType? item) => @@ -300,7 +299,7 @@ public void SingleOrAbsentByPredicateAndFactory_ListPredicateResultIsTrueMoreTha var createdException = new SomeException(); var actualException = Assert.Throws(Test); - Assert.AreSame(createdException, actualException); + Assert.That(actualException, Is.SameAs(createdException)); void Test() => diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/SingleOrAbsent.ReadOnlyList.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/SingleOrAbsent.ReadOnlyList.cs similarity index 89% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/SingleOrAbsent.ReadOnlyList.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/SingleOrAbsent.ReadOnlyList.cs index 025d4c49..b7f1cfd1 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/SingleOrAbsent.ReadOnlyList.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/SingleOrAbsent.ReadOnlyList.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 SingleOrAbsent_ReadOnlyListSourceIsNull_ExpectArgumentNullException( IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -30,7 +29,7 @@ public void SingleOrAbsent_ReadOnlyListSourceIsEmpty_ExpectAbsent() var actual = source.SingleOrAbsent(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +42,7 @@ public void SingleOrAbsent_ReadOnlyListSourceContainsOnlyOneElement_ExpectPresen var actual = source.SingleOrAbsent(); var expected = Optional.Present(singleItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -63,7 +62,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListSourceIsNull_ExpectAr IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -77,7 +76,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListExceptionFactoryIsNul Func exceptionFactory = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("moreThanOneElementExceptionFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("moreThanOneElementExceptionFactory")); void Test() => @@ -92,7 +91,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListSourceIsEmpty_ExpectA var actual = source.SingleOrAbsent(CreateSomeException); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -105,7 +104,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListSourceContainsOnlyOne var actual = source.SingleOrAbsent(CreateSomeException); var expected = Optional.Present(singleItem); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -115,7 +114,7 @@ public void SingleOrAbsentWithExceptionFactory_ReadOnlyListSourceContainsMoreTha var createdException = new SomeException(); var ex = Assert.Throws(Test); - Assert.AreSame(createdException, ex); + Assert.That(ex, Is.SameAs(createdException)); void Test() => @@ -128,7 +127,7 @@ public void SingleOrAbsentByPredicate_ReadOnlyListSourceIsNull_ExpectArgumentNul IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -142,7 +141,7 @@ public void SingleOrAbsentByPredicate_ReadOnlyListPredicateIsNull_ExpectArgument Func predicate = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -157,7 +156,7 @@ public void SingleOrAbsentByPredicate_ReadOnlyListPredicateResultIsAlreadyFalse_ var actual = source.SingleOrAbsent(static _ => false); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -174,7 +173,7 @@ public void SingleOrAbsentByPredicate_ReadOnlyListPredicateResultIsTrueOnlyOnce_ var actual = source.SingleOrAbsent(item => expectedText.Equals(item?.Text, StringComparison.InvariantCultureIgnoreCase)); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -212,7 +211,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListSourceIsNull_ExpectA IReadOnlyList source = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("source", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("source")); void Test() => @@ -226,7 +225,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListPredicateIsNull_Expe Func predicate = null!; var ex = Assert.Throws(Test); - Assert.AreEqual("predicate", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("predicate")); void Test() => @@ -239,7 +238,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListExceptionFactoryIsNu var source = CreateReadOnlyList(MinusFifteenIdRefType); var ex = Assert.Throws(Test); - Assert.AreEqual("moreThanOneMatchExceptionFactory", ex?.ParamName); + Assert.That(ex!.ParamName, Is.EqualTo("moreThanOneMatchExceptionFactory")); void Test() => @@ -254,7 +253,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListPredicateResultIsAlr var actual = source.SingleOrAbsent(static _ => false, CreateSomeException); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -272,7 +271,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListPredicateResultIsTru var actual = source.SingleOrAbsent(item => expectedText.Equals(item?.Text, StringComparison.InvariantCultureIgnoreCase), CreateSomeException); var expected = Optional.Present(expectedValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -296,7 +295,7 @@ public void SingleOrAbsentByPredicateAndFactory_ReadOnlyListPredicateResultIsTru var createdException = new SomeException(); var actualException = Assert.Throws(Test); - Assert.AreSame(createdException, actualException); + Assert.That(actualException, Is.SameAs(createdException)); void Test() => diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/Tests.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/Tests.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/Tests.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/Tests.cs diff --git a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/TryGetValueOrAbsent.cs b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/TryGetValueOrAbsent.cs similarity index 92% rename from src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/TryGetValueOrAbsent.cs rename to src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/TryGetValueOrAbsent.cs index cc0b9d5f..85f6d7a3 100644 --- a/src/core-taggeds-optional/Optional.Tests/OptionalLinqExtensions.Tests/TryGetValueOrAbsent.cs +++ b/src/core-taggeds-optional/Optional.Tests.Old/OptionalLinqExtensions.Tests/TryGetValueOrAbsent.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -19,9 +18,8 @@ public void TryGetValueOrAbsent_ExpectIsObsolete() .Where(method => method.Name == nameof(OptionalLinqExtensions.TryGetValueOrAbsent)) .ToArray(); - Assert.AreEqual( - 1, - methods.Count( + Assert.That( + methods.Count( method => method.CustomAttributes.Any( attr @@ -35,6 +33,7 @@ public void TryGetValueOrAbsent_ExpectIsObsolete() attr.ConstructorArguments[0].ArgumentType == typeof(string) && attr.ConstructorArguments[0].Value is expectedObsoleteMessage && attr.ConstructorArguments[1].ArgumentType == typeof(bool) && - attr.ConstructorArguments[1].Value is true))); + attr.ConstructorArguments[1].Value is true)), + Is.EqualTo(1)); } } diff --git a/src/core-taggeds-optional/Optional.Tests/TestData/IAction.cs b/src/core-taggeds-optional/Optional.Tests.Old/TestData/IAction.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/TestData/IAction.cs rename to src/core-taggeds-optional/Optional.Tests.Old/TestData/IAction.cs diff --git a/src/core-taggeds-optional/Optional.Tests/TestData/IFunc.cs b/src/core-taggeds-optional/Optional.Tests.Old/TestData/IFunc.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/TestData/IFunc.cs rename to src/core-taggeds-optional/Optional.Tests.Old/TestData/IFunc.cs diff --git a/src/core-taggeds-optional/Optional.Tests/TestData/SomeException.cs b/src/core-taggeds-optional/Optional.Tests.Old/TestData/SomeException.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/TestData/SomeException.cs rename to src/core-taggeds-optional/Optional.Tests.Old/TestData/SomeException.cs diff --git a/src/core-taggeds-optional/Optional.Tests/TestData/StubDictionary.cs b/src/core-taggeds-optional/Optional.Tests.Old/TestData/StubDictionary.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/TestData/StubDictionary.cs rename to src/core-taggeds-optional/Optional.Tests.Old/TestData/StubDictionary.cs diff --git a/src/core-taggeds-optional/Optional.Tests/TestData/StubList.cs b/src/core-taggeds-optional/Optional.Tests.Old/TestData/StubList.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/TestData/StubList.cs rename to src/core-taggeds-optional/Optional.Tests.Old/TestData/StubList.cs diff --git a/src/core-taggeds-optional/Optional.Tests/TestData/StubReadOnlyDictionary.cs b/src/core-taggeds-optional/Optional.Tests.Old/TestData/StubReadOnlyDictionary.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/TestData/StubReadOnlyDictionary.cs rename to src/core-taggeds-optional/Optional.Tests.Old/TestData/StubReadOnlyDictionary.cs diff --git a/src/core-taggeds-optional/Optional.Tests/TestData/StubReadOnlyList.cs b/src/core-taggeds-optional/Optional.Tests.Old/TestData/StubReadOnlyList.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/TestData/StubReadOnlyList.cs rename to src/core-taggeds-optional/Optional.Tests.Old/TestData/StubReadOnlyList.cs diff --git a/src/core-taggeds-optional/Optional.Tests/TestData/StubType.cs b/src/core-taggeds-optional/Optional.Tests.Old/TestData/StubType.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/TestData/StubType.cs rename to src/core-taggeds-optional/Optional.Tests.Old/TestData/StubType.cs diff --git a/src/core-taggeds-optional/Optional.Tests/TestData/TestDataSource.cs b/src/core-taggeds-optional/Optional.Tests.Old/TestData/TestDataSource.cs similarity index 100% rename from src/core-taggeds-optional/Optional.Tests/TestData/TestDataSource.cs rename to src/core-taggeds-optional/Optional.Tests.Old/TestData/TestDataSource.cs diff --git a/src/core-taggeds-optional/Optional.Tests/GlobalUsings.cs b/src/core-taggeds-optional/Optional.Tests/GlobalUsings.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/src/core-taggeds-optional/Optional.Tests/GlobalUsings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/src/core-taggeds-optional/Optional.Tests/Optional.Tests.csproj b/src/core-taggeds-optional/Optional.Tests/Optional.Tests.csproj index 08dae0b9..5f8e73e9 100644 --- a/src/core-taggeds-optional/Optional.Tests/Optional.Tests.csproj +++ b/src/core-taggeds-optional/Optional.Tests/Optional.Tests.csproj @@ -1,24 +1,28 @@ - + - net6.0;net7.0 + net6.0;net7.0;net8.0 + latest disable enable true true false + true Andrei Sergeev, Pavel Moskovoy - Copyright © 2020-2023 Andrei Sergeev, Pavel Moskovoy + Copyright © 2020-2024 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack.Core.Tests PrimeFuncPack.Core.Optional.Tests - - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/core-taggeds-optional/Optional.Tests/TestStub.cs b/src/core-taggeds-optional/Optional.Tests/TestStub.cs new file mode 100644 index 00000000..05f82c8d --- /dev/null +++ b/src/core-taggeds-optional/Optional.Tests/TestStub.cs @@ -0,0 +1,10 @@ +namespace PrimeFuncPack.Core.Tests; + +public static class TestStub +{ + [Fact] + public static void TestTrue() + { + Assert.True(true); + } +} diff --git a/src/core-taggeds-optional/Optional/Optional.csproj b/src/core-taggeds-optional/Optional/Optional.csproj index 616f8549..5b9295e1 100644 --- a/src/core-taggeds-optional/Optional/Optional.csproj +++ b/src/core-taggeds-optional/Optional/Optional.csproj @@ -1,7 +1,8 @@  - net6.0;net7.0 + net6.0;net7.0;net8.0 + latest disable enable true @@ -13,11 +14,11 @@ https://github.com/pfpack/pfpack-core-taggeds pfpack Andrei Sergeev, Pavel Moskovoy - Copyright © 2020-2023 Andrei Sergeev, Pavel Moskovoy + Copyright © 2020-2024 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Core.Optional is a core library for .NET consisting of Optional monad targeted for use in functional programming. System PrimeFuncPack.Core.Optional - 2.2.0-preview.3 + 2.2.0-preview.4 @@ -32,7 +33,7 @@ - + \ No newline at end of file diff --git a/src/core-taggeds-result/Result.Tests.Old/Result.Tests.Old.csproj b/src/core-taggeds-result/Result.Tests.Old/Result.Tests.Old.csproj index e0080c05..66b587db 100644 --- a/src/core-taggeds-result/Result.Tests.Old/Result.Tests.Old.csproj +++ b/src/core-taggeds-result/Result.Tests.Old/Result.Tests.Old.csproj @@ -16,14 +16,14 @@ + - all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/core-taggeds-result/Result.Tests/Result.Tests.csproj b/src/core-taggeds-result/Result.Tests/Result.Tests.csproj index 7a565fe2..66adf18c 100644 --- a/src/core-taggeds-result/Result.Tests/Result.Tests.csproj +++ b/src/core-taggeds-result/Result.Tests/Result.Tests.csproj @@ -16,15 +16,12 @@ + - runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all diff --git a/src/core-taggeds-union/TaggedUnion.Tests.Old/TaggedUnion.Tests.Old.csproj b/src/core-taggeds-union/TaggedUnion.Tests.Old/TaggedUnion.Tests.Old.csproj index 161f96d8..affe990a 100644 --- a/src/core-taggeds-union/TaggedUnion.Tests.Old/TaggedUnion.Tests.Old.csproj +++ b/src/core-taggeds-union/TaggedUnion.Tests.Old/TaggedUnion.Tests.Old.csproj @@ -20,14 +20,14 @@ + - all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj b/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj index fc7482cc..f986cf76 100644 --- a/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj +++ b/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj @@ -16,14 +16,14 @@ + - all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj b/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj index 0a81cce5..8dea4d2e 100644 --- a/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj +++ b/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj @@ -16,15 +16,12 @@ + - runtime; build; native; contentfiles; analyzers; buildtransitive all - - runtime; build; native; contentfiles; analyzers; buildtransitive - all diff --git a/src/core-taggeds/Taggeds/Taggeds.csproj b/src/core-taggeds/Taggeds/Taggeds.csproj index b926a1b6..20ba6827 100644 --- a/src/core-taggeds/Taggeds/Taggeds.csproj +++ b/src/core-taggeds/Taggeds/Taggeds.csproj @@ -34,7 +34,7 @@ - +