diff --git a/LICENSE b/LICENSE index a5679aa..c1eaf46 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022-2024 Andrei Sergeev, Pavel Moskovoy +Copyright (c) 2022-2025 Andrei Sergeev, Pavel Moskovoy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Array/ArrayEqualityComparer_TestsBase.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Array/ArrayEqualityComparer_TestsBase.cs index a7509f3..bdd170e 100644 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Array/ArrayEqualityComparer_TestsBase.cs +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Array/ArrayEqualityComparer_TestsBase.cs @@ -30,6 +30,16 @@ public static void Test_GetHashCode_InputsAreEqual_ExpectHashCodesAreEqual(CaseP Assert.StrictEqual(hashCode1, hashCode2); } + [Theory] + [MemberData(nameof(GetHashCode_InputsAreNotEqualCases))] + public static void Test_GetHashCode_InputsAreNotEqual_ExpectHashCodesAreNotEqual(CaseParamOfArray input1, CaseParamOfArray input2) + { + var comparer = BuildComparer(); + var hashCode1 = comparer.GetHashCode(input1.Items); + var hashCode2 = comparer.GetHashCode(input2.Items); + Assert.NotStrictEqual(hashCode1, hashCode2); + } + [Theory] [MemberData(nameof(InputsAreEqualCases))] public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfArray input1, CaseParamOfArray input2) @@ -40,8 +50,8 @@ public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfArray inp } [Theory] - [MemberData(nameof(InputsAreNotEqualCases))] - public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfArray input1, CaseParamOfArray input2) + [MemberData(nameof(Equals_InputsAreNotEqualCases))] + public static void Test_Equals_InputsAreNotEqual_ExpectFalse(CaseParamOfArray input1, CaseParamOfArray input2) { var comparer = BuildComparer(); var actualEquals = comparer.Equals(input1.Items, input2.Items); @@ -74,11 +84,15 @@ public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfArray public static TheoryData, CaseParamOfArray> InputsAreEqualCases() => - MapEqualsCases(CaseSources.EqualArrays()); + MapEqualsCases(EqualCaseSource.EqualArrays()); + + public static TheoryData, CaseParamOfArray> Equals_InputsAreNotEqualCases() + => + MapEqualsCases(NotEqualCaseSource_Equals.NotEqualArrays()); - public static TheoryData, CaseParamOfArray> InputsAreNotEqualCases() + public static TheoryData, CaseParamOfArray> GetHashCode_InputsAreNotEqualCases() => - MapEqualsCases(CaseSources.NotEqualArrays()); + MapEqualsCases(NotEqualCaseSource_GetHashCode.NotEqualArrays()); private static ArrayEqualityComparer BuildComparer() => diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/EqualCaseSource.InnerEqualArraysOfInt32Nullable.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/EqualCaseSource.InnerEqualArraysOfInt32Nullable.cs new file mode 100644 index 0000000..384c65f --- /dev/null +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/EqualCaseSource.InnerEqualArraysOfInt32Nullable.cs @@ -0,0 +1,69 @@ +#pragma warning disable IDE0300 // Simplify collection initialization + +using System.Collections.Generic; + +namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; + +partial class EqualCaseSource +{ + private static IEnumerable<(int?[]? X, int?[]? Y)> InnerEqualArraysOfInt32Nullable() + { + // Equal by reference + + yield return ( + null, + null + ); + yield return ( + EmptyArray.Value, + EmptyArray.Value + ); + var array1 = new int?[] { 1 }; + var array2 = new int?[] { 1, 2 }; + var array3 = new int?[] { 1, 2, 3 }; + var array4 = new int?[] { 1, 2, 3, 4 }; + yield return ( + array1, + array1 + ); + yield return ( + array2, + array2 + ); + yield return ( + array3, + array3 + ); + yield return ( + array4, + array4 + ); + + // Equal by value + + yield return ( + new int?[] { null }, + new int?[] { null } + ); + yield return ( + EmptyArray.Create(), + EmptyArray.Create() + ); + yield return ( + new int?[] { 1 }, + new int?[] { 1 } + ); + yield return ( + new int?[] { 1, 2 }, + new int?[] { 1, 2 } + ); + yield return ( + new int?[] { 1, 2, 3 }, + new int?[] { 1, 2, 3 } + ); + yield return ( + new int?[] { 1, 2, 3, 4 }, + new int?[] { 1, 2, 3, 4 } + ); + } +} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/EqualCaseSource.InnerEqualArraysOfString.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/EqualCaseSource.InnerEqualArraysOfString.cs new file mode 100644 index 0000000..28fa139 --- /dev/null +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/EqualCaseSource.InnerEqualArraysOfString.cs @@ -0,0 +1,70 @@ +#pragma warning disable IDE0300 // Simplify collection initialization + +using System.Collections.Generic; + +namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; + +partial class EqualCaseSource +{ + private static IEnumerable<(string?[]? X, string?[]? Y)> InnerEqualArraysOfString() + { + // Equal by reference + + yield return ( + null, + null + ); + yield return ( + EmptyArray.Value, + EmptyArray.Value + ); + var array1 = new[] { "1" }; + var array2 = new[] { "1", "2" }; + var array3 = new[] { "1", "2", "3" }; + var array4 = new[] { "1", "2", "3", "4" }; + yield return ( + array1, + array1 + ); + yield return ( + array2, + array2 + ); + yield return ( + array3, + array3 + ); + yield return ( + array4, + array4 + ); + + // Equal by value + + yield return ( + new[] { (string?)null }, + new[] { (string?)null } + ); + yield return ( + EmptyArray.Create(), + EmptyArray.Create() + ); + yield return ( + new[] { "1" }, + new[] { "1" } + ); + yield return ( + new[] { "1", "2" }, + new[] { "1", "2" } + ); + yield return ( + new[] { "1", "2", "3" }, + new[] { "1", "2", "3" } + ); + yield return ( + new[] { "1", "2", "3", "4" }, + new[] { "1", "2", "3", "4" } + ); + } + +} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/EqualCaseSource.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/EqualCaseSource.cs new file mode 100644 index 0000000..59262bf --- /dev/null +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/EqualCaseSource.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; + +internal static partial class EqualCaseSource +{ + internal static IEnumerable<(T[]? X, T[]? Y)> EqualArrays() + { + if (typeof(T) == typeof(string)) + { + return (IEnumerable<(T[]? X, T[]? Y)>)InnerEqualArraysOfString(); + } + + if (typeof(T) == typeof(int?)) + { + return (IEnumerable<(T[]? X, T[]? Y)>)InnerEqualArraysOfInt32Nullable(); + } + + throw new ArgumentException($"An unexpected type ({typeof(T).Name}).", nameof(T)); + } +} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_Equals.InnerNotEqualArraysOfInt32Nullable.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_Equals.InnerNotEqualArraysOfInt32Nullable.cs new file mode 100644 index 0000000..03700f6 --- /dev/null +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_Equals.InnerNotEqualArraysOfInt32Nullable.cs @@ -0,0 +1,71 @@ +#pragma warning disable IDE0300 // Simplify collection initialization + +using System.Collections.Generic; + +namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; + +partial class NotEqualCaseSource_Equals +{ + private static IEnumerable<(int?[]? X, int?[]? Y)> InnerNotEqualArraysOfInt32Nullable() + { + yield return ( + null, + EmptyArray.Value); + yield return ( + null, + new int?[] { 1 } + ); + yield return ( + EmptyArray.Value, + new int?[] { 1 } + ); + yield return ( + new int?[] { 1 }, + new int?[] { 1, 2 } + ); + yield return ( + new int?[] { 1, 2 }, + new int?[] { 1, 2, 3 } + ); + yield return ( + new int?[] { 1, 2, 3 }, + new int?[] { 1, 2, 3, 4 } + ); + yield return ( + new int?[] { null }, + new int?[] { 0 } + ); + yield return ( + new int?[] { null }, + new int?[] { 1 } + ); + yield return ( + new int?[] { 1 }, + new int?[] { 2 } + ); + yield return ( + new int?[] { 1, 2 }, + new int?[] { 1, 1 } + ); + yield return ( + new int?[] { 1, 2, 3 }, + new int?[] { 1, 0, 3 } + ); + yield return ( + new int?[] { 1, 2, 3, 4 }, + new int?[] { 0, 2, 3, 4 } + ); + yield return ( + new int?[] { 1, 2, 3, 4 }, + new int?[] { 1, 1, 3, 4 } + ); + yield return ( + new int?[] { 1, 2, 3, 4 }, + new int?[] { 1, 2, 2, 4 } + ); + yield return ( + new int?[] { 1, 2, 3, 4 }, + new int?[] { 1, 2, 3, 3 } + ); + } +} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_Equals.InnerNotEqualArraysOfString.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_Equals.InnerNotEqualArraysOfString.cs new file mode 100644 index 0000000..3273b45 --- /dev/null +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_Equals.InnerNotEqualArraysOfString.cs @@ -0,0 +1,71 @@ +#pragma warning disable IDE0300 // Simplify collection initialization + +using System.Collections.Generic; + +namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; + +partial class NotEqualCaseSource_Equals +{ + private static IEnumerable<(string?[]? X, string?[]? Y)> InnerNotEqualArraysOfString() + { + yield return ( + null, + EmptyArray.Value); + yield return ( + null, + new[] { "1" } + ); + yield return ( + EmptyArray.Value, + new[] { "1" } + ); + yield return ( + new[] { "1" }, + new[] { "1", "2" } + ); + yield return ( + new[] { "1", "2" }, + new[] { "1", "2", "3" } + ); + yield return ( + new[] { "1", "2", "3" }, + new[] { "1", "2", "3", "4" } + ); + yield return ( + new[] { (string?)null }, + new[] { "" } + ); + yield return ( + new[] { (string?)null }, + new[] { "1" } + ); + yield return ( + new[] { "1" }, + new[] { "2" } + ); + yield return ( + new[] { "1", "2" }, + new[] { "1", "1" } + ); + yield return ( + new[] { "1", "2", "3" }, + new[] { "1", "0", "3" } + ); + yield return ( + new[] { "1", "2", "3", "4" }, + new[] { "0", "2", "3", "4" } + ); + yield return ( + new[] { "1", "2", "3", "4" }, + new[] { "1", "1", "3", "4" } + ); + yield return ( + new[] { "1", "2", "3", "4" }, + new[] { "1", "2", "2", "4" } + ); + yield return ( + new[] { "1", "2", "3", "4" }, + new[] { "1", "2", "3", "3" } + ); + } +} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_Equals.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_Equals.cs new file mode 100644 index 0000000..86a3593 --- /dev/null +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_Equals.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; + +internal static partial class NotEqualCaseSource_Equals +{ + internal static IEnumerable<(T[]? X, T[]? Y)> NotEqualArrays() + => + InnerNotEqualArrays().ToArray() switch + { + var pairs => pairs.Concat(pairs.Select(pair => (pair.Y, pair.X))) + }; + + private static IEnumerable<(T[]? X, T[]? Y)> InnerNotEqualArrays() + { + if (typeof(T) == typeof(string)) + { + return (IEnumerable<(T[]? X, T[]? Y)>)InnerNotEqualArraysOfString(); + } + + if (typeof(T) == typeof(int?)) + { + return (IEnumerable<(T[]? X, T[]? Y)>)InnerNotEqualArraysOfInt32Nullable(); + } + + throw new ArgumentException($"An unexpected type ({typeof(T).Name}).", nameof(T)); + } +} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_GetHashCode.InnerNotEqualArraysOfInt32Nullable.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_GetHashCode.InnerNotEqualArraysOfInt32Nullable.cs new file mode 100644 index 0000000..ed01282 --- /dev/null +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_GetHashCode.InnerNotEqualArraysOfInt32Nullable.cs @@ -0,0 +1,47 @@ +#pragma warning disable IDE0300 // Simplify collection initialization + +using System.Collections.Generic; + +namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; + +partial class NotEqualCaseSource_GetHashCode +{ + private static IEnumerable<(int?[]? X, int?[]? Y)> InnerNotEqualArraysOfInt32Nullable() + { + yield return ( + null, + EmptyArray.Value); + yield return ( + null, + new int?[] { 1 } + ); + yield return ( + EmptyArray.Value, + new int?[] { 1 } + ); + yield return ( + new int?[] { 1 }, + new int?[] { 1, 2 } + ); + yield return ( + new int?[] { 1, 2 }, + new int?[] { 1, 2, 3 } + ); + yield return ( + new int?[] { null }, + new int?[] { 1 } + ); + yield return ( + new int?[] { 1 }, + new int?[] { 2 } + ); + yield return ( + new int?[] { 1, 2 }, + new int?[] { 1, 1 } + ); + yield return ( + new int?[] { 1, 2, 3 }, + new int?[] { 1, 0, 3 } + ); + } +} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_GetHashCode.InnerNotEqualArraysOfString.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_GetHashCode.InnerNotEqualArraysOfString.cs new file mode 100644 index 0000000..ee39163 --- /dev/null +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_GetHashCode.InnerNotEqualArraysOfString.cs @@ -0,0 +1,47 @@ +#pragma warning disable IDE0300 // Simplify collection initialization + +using System.Collections.Generic; + +namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; + +partial class NotEqualCaseSource_GetHashCode +{ + private static IEnumerable<(string?[]? X, string?[]? Y)> InnerNotEqualArraysOfString() + { + yield return ( + null, + EmptyArray.Value); + yield return ( + null, + new[] { "1" } + ); + yield return ( + EmptyArray.Value, + new[] { "1" } + ); + yield return ( + new[] { "1" }, + new[] { "1", "2" } + ); + yield return ( + new[] { "1", "2" }, + new[] { "1", "2", "3" } + ); + yield return ( + new[] { (string?)null }, + new[] { "1" } + ); + yield return ( + new[] { "1" }, + new[] { "2" } + ); + yield return ( + new[] { "1", "2" }, + new[] { "1", "1" } + ); + yield return ( + new[] { "1", "2", "3" }, + new[] { "1", "0", "3" } + ); + } +} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_GetHashCode.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_GetHashCode.cs new file mode 100644 index 0000000..afb6a09 --- /dev/null +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/CaseSources/NotEqualCaseSource_GetHashCode.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; + +internal static partial class NotEqualCaseSource_GetHashCode +{ + // Here it is assumed a small set consisting of short arrays + // should lead to different hash codes with no collisions + internal static IEnumerable<(T[]? X, T[]? Y)> NotEqualArrays() + { + if (typeof(T) == typeof(string)) + { + return (IEnumerable<(T[]? X, T[]? Y)>)InnerNotEqualArraysOfString(); + } + + if (typeof(T) == typeof(int?)) + { + return (IEnumerable<(T[]? X, T[]? Y)>)InnerNotEqualArraysOfInt32Nullable(); + } + + throw new ArgumentException($"An unexpected type ({typeof(T).Name}).", nameof(T)); + } +} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Collections.Generic.EqualityComparers.Tests.csproj b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Collections.Generic.EqualityComparers.Tests.csproj index cd0f0b9..894c914 100644 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Collections.Generic.EqualityComparers.Tests.csproj +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Collections.Generic.EqualityComparers.Tests.csproj @@ -11,7 +11,7 @@ false true Andrei Sergeev, Pavel Moskovoy - Copyright © 2022-2024 Andrei Sergeev, Pavel Moskovoy + Copyright © 2022-2025 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack.Collections.Generic.EqualityComparers.Tests PrimeFuncPack.Collections.Generic.EqualityComparers.Tests @@ -21,7 +21,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseSources.ArraysOfInt32Nullable.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseSources.ArraysOfInt32Nullable.cs deleted file mode 100644 index 0087b40..0000000 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseSources.ArraysOfInt32Nullable.cs +++ /dev/null @@ -1,137 +0,0 @@ -#pragma warning disable IDE0300 // Simplify collection initialization - -using System.Collections.Generic; - -namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; - -partial class CaseSources -{ - private static IEnumerable<(int?[]? X, int?[]? Y)> EqualArraysOfInt32Nullable() - { - // Equal by reference - - yield return ( - null, - null - ); - yield return ( - EmptyArray.Value, - EmptyArray.Value - ); - var array1 = new int?[] { 1 }; - var array2 = new int?[] { 1, 2 }; - var array3 = new int?[] { 1, 2, 3 }; - var array4 = new int?[] { 1, 2, 3, 4 }; - yield return ( - array1, - array1 - ); - yield return ( - array2, - array2 - ); - yield return ( - array3, - array3 - ); - yield return ( - array4, - array4 - ); - - // Equal by value - - yield return ( - EmptyArray.Create(), - EmptyArray.Create() - ); - yield return ( - new int?[] { null }, - new int?[] { null } - ); - yield return ( - new int?[] { 1 }, - new int?[] { 1 } - ); - yield return ( - new int?[] { 1, 2 }, - new int?[] { 1, 2 } - ); - yield return ( - new int?[] { 1, 2, 3 }, - new int?[] { 1, 2, 3 } - ); - yield return ( - new int?[] { 1, 2, 3, 4 }, - new int?[] { 1, 2, 3, 4 } - ); - } - - private static IEnumerable<(int?[]? X, int?[]? Y)> NotEqualArraysOfInt32Nullable() - { - yield return ( - null, - new int?[] { 1 } - ); - yield return ( - new int?[] { 1 }, - null - ); - yield return ( - EmptyArray.Value, - new int?[] { 1 } - ); - yield return ( - new int?[] { 1 }, - EmptyArray.Value - ); - yield return ( - new int?[] { 1 }, - new int?[] { 1, 2 } - ); - yield return ( - new int?[] { 1, 2 }, - new int?[] { 1 } - ); - yield return ( - new int?[] { 1, 2 }, - new int?[] { 1, 2, 3 } - ); - yield return ( - new int?[] { 1, 2, 3 }, - new int?[] { 1, 2 } - ); - yield return ( - new int?[] { 1, 2, 3 }, - new int?[] { 1, 2, 3, 4 } - ); - yield return ( - new int?[] { 1, 2, 3, 4 }, - new int?[] { 1, 2, 3 } - ); - yield return ( - new int?[] { null }, - new int?[] { 1 } - ); - yield return ( - new int?[] { 1 }, - new int?[] { null } - ); - yield return ( - new int?[] { 1, 2, 3, 3 }, - new int?[] { 1, 2, 3, 4 } - ); - yield return ( - new int?[] { 1, 2, 2, 4 }, - new int?[] { 1, 2, 3, 4 } - ); - yield return ( - new int?[] { 1, 1, 3, 4 }, - new int?[] { 1, 2, 3, 4 } - ); - yield return ( - new int?[] { 0, 2, 3, 4 }, - new int?[] { 1, 2, 3, 4 } - ); - } -} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseSources.ArraysOfString.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseSources.ArraysOfString.cs deleted file mode 100644 index e5152e9..0000000 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseSources.ArraysOfString.cs +++ /dev/null @@ -1,137 +0,0 @@ -#pragma warning disable IDE0300 // Simplify collection initialization - -using System.Collections.Generic; - -namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; - -partial class CaseSources -{ - private static IEnumerable<(string?[]? X, string?[]? Y)> EqualArraysOfString() - { - // Equal by reference - - yield return ( - null, - null - ); - yield return ( - EmptyArray.Value, - EmptyArray.Value - ); - var array1 = new[] { "1" }; - var array2 = new[] { "1", "2" }; - var array3 = new[] { "1", "2", "3" }; - var array4 = new[] { "1", "2", "3", "4" }; - yield return ( - array1, - array1 - ); - yield return ( - array2, - array2 - ); - yield return ( - array3, - array3 - ); - yield return ( - array4, - array4 - ); - - // Equal by value - - yield return ( - EmptyArray.Create(), - EmptyArray.Create() - ); - yield return ( - new[] { (string?)null }, - new[] { (string?)null } - ); - yield return ( - new[] { "1" }, - new[] { "1" } - ); - yield return ( - new[] { "1", "2" }, - new[] { "1", "2" } - ); - yield return ( - new[] { "1", "2", "3" }, - new[] { "1", "2", "3" } - ); - yield return ( - new[] { "1", "2", "3", "4" }, - new[] { "1", "2", "3", "4" } - ); - } - - private static IEnumerable<(string?[]? X, string?[]? Y)> NotEqualArraysOfString() - { - yield return ( - null, - new[] { "1" } - ); - yield return ( - new[] { "1" }, - null - ); - yield return ( - EmptyArray.Value, - new[] { "1" } - ); - yield return ( - new[] { "1" }, - EmptyArray.Value - ); - yield return ( - new[] { "1" }, - new[] { "1", "2" } - ); - yield return ( - new[] { "1", "2" }, - new[] { "1" } - ); - yield return ( - new[] { "1", "2" }, - new[] { "1", "2", "3" } - ); - yield return ( - new[] { "1", "2", "3" }, - new[] { "1", "2" } - ); - yield return ( - new[] { "1", "2", "3" }, - new[] { "1", "2", "3", "4" } - ); - yield return ( - new[] { "1", "2", "3", "4" }, - new[] { "1", "2", "3" } - ); - yield return ( - new[] { (string?)null }, - new[] { "1" } - ); - yield return ( - new[] { "1" }, - new[] { (string?)null } - ); - yield return ( - new[] { "1", "2", "3", "3" }, - new[] { "1", "2", "3", "4" } - ); - yield return ( - new[] { "1", "2", "2", "4" }, - new[] { "1", "2", "3", "4" } - ); - yield return ( - new[] { "1", "1", "3", "4" }, - new[] { "1", "2", "3", "4" } - ); - yield return ( - new[] { "0", "2", "3", "4" }, - new[] { "1", "2", "3", "4" } - ); - } -} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseSources.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseSources.cs deleted file mode 100644 index 6ea25aa..0000000 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseSources.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace PrimeFuncPack.Collections.Generic.EqualityComparers.Tests; - -internal static partial class CaseSources -{ - internal static IEnumerable<(T[]? X, T[]? Y)> EqualArrays() - { - if (typeof(T) == typeof(string)) - { - return (IEnumerable<(T[]? X, T[]? Y)>)EqualArraysOfString(); - } - - if (typeof(T) == typeof(int?)) - { - return (IEnumerable<(T[]? X, T[]? Y)>)EqualArraysOfInt32Nullable(); - } - - throw new ArgumentException($"An unexpected type ({typeof(T).Name}).", nameof(T)); - } - - internal static IEnumerable<(T[]? X, T[]? Y)> NotEqualArrays() - { - if (typeof(T) == typeof(string)) - { - return (IEnumerable<(T[]? X, T[]? Y)>)NotEqualArraysOfString(); - } - - if (typeof(T) == typeof(int?)) - { - return (IEnumerable<(T[]? X, T[]? Y)>)NotEqualArraysOfInt32Nullable(); - } - - - throw new ArgumentException($"An unexpected type ({typeof(T).Name}).", nameof(T)); - } -} diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseParam.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CaseParam.cs similarity index 100% rename from src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseParam.cs rename to src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CaseParam.cs diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseParamsMapper.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CaseParamsMapper.cs similarity index 100% rename from src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CaseParamsMapper.cs rename to src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CaseParamsMapper.cs diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CustomEqualityComparer.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CustomEqualityComparer.cs similarity index 100% rename from src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CustomEqualityComparer.cs rename to src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CustomEqualityComparer.cs diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CustomList.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CustomList.cs similarity index 100% rename from src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CustomList.cs rename to src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CustomList.cs diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CustomReadOnlyList.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CustomReadOnlyList.cs similarity index 100% rename from src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/CustomReadOnlyList.cs rename to src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/CustomReadOnlyList.cs diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/EmptyArray.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/EmptyArray.cs similarity index 100% rename from src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/EmptyArray.cs rename to src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/EmptyArray.cs diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/FactoryAssert.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/FactoryAssert.cs similarity index 100% rename from src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Common/FactoryAssert.cs rename to src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/Helpers/FactoryAssert.cs diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ImmutableArray/ImmutableArrayEqualityComparer_Nonnull_TestsBase.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ImmutableArray/ImmutableArrayEqualityComparer_Nonnull_TestsBase.cs index 3431485..41a42cf 100644 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ImmutableArray/ImmutableArrayEqualityComparer_Nonnull_TestsBase.cs +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ImmutableArray/ImmutableArrayEqualityComparer_Nonnull_TestsBase.cs @@ -25,6 +25,16 @@ public static void Test_GetHashCode_InputsAreEqual_ExpectHashCodesAreEqual(CaseP Assert.StrictEqual(hashCode1, hashCode2); } + [Theory] + [MemberData(nameof(GetHashCode_InputsAreNotEqualCases))] + public static void Test_GetHashCode_InputsAreNotEqual_ExpectHashCodesAreNotEqual(CaseParamOfImmutableArray input1, CaseParamOfImmutableArray input2) + { + var comparer = BuildComparer(); + var hashCode1 = comparer.GetHashCode(input1.Items); + var hashCode2 = comparer.GetHashCode(input2.Items); + Assert.NotStrictEqual(hashCode1, hashCode2); + } + [Theory] [MemberData(nameof(InputsAreEqualCases))] public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfImmutableArray input1, CaseParamOfImmutableArray input2) @@ -35,8 +45,8 @@ public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfImmutableArr } [Theory] - [MemberData(nameof(InputsAreNotEqualCases))] - public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfImmutableArray input1, CaseParamOfImmutableArray input2) + [MemberData(nameof(Equals_InputsAreNotEqualCases))] + public static void Test_Equals_InputsAreNotEqual_ExpectFalse(CaseParamOfImmutableArray input1, CaseParamOfImmutableArray input2) { var comparer = BuildComparer(); var actualEquals = comparer.Equals(input1.Items, input2.Items); @@ -45,11 +55,15 @@ public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfImmutable public static TheoryData, CaseParamOfImmutableArray> InputsAreEqualCases() => - MapEqualsCases(CaseSources.EqualArrays()); + MapEqualsCases(EqualCaseSource.EqualArrays()); + + public static TheoryData, CaseParamOfImmutableArray> Equals_InputsAreNotEqualCases() + => + MapEqualsCases(NotEqualCaseSource_Equals.NotEqualArrays()); - public static TheoryData, CaseParamOfImmutableArray> InputsAreNotEqualCases() + public static TheoryData, CaseParamOfImmutableArray> GetHashCode_InputsAreNotEqualCases() => - MapEqualsCases(CaseSources.NotEqualArrays()); + MapEqualsCases(NotEqualCaseSource_GetHashCode.NotEqualArrays()); private static TheoryData, CaseParamOfImmutableArray> MapEqualsCases( IEnumerable<(T[]? X, T[]? Y)> cases) diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ImmutableArray/ImmutableArrayEqualityComparer_Nullable_TestsBase.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ImmutableArray/ImmutableArrayEqualityComparer_Nullable_TestsBase.cs index 01285d0..329d2a5 100644 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ImmutableArray/ImmutableArrayEqualityComparer_Nullable_TestsBase.cs +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ImmutableArray/ImmutableArrayEqualityComparer_Nullable_TestsBase.cs @@ -33,6 +33,16 @@ public static void Test_GetHashCode_InputsAreEqual_ExpectHashCodesAreEqual(CaseP Assert.StrictEqual(hashCode1, hashCode2); } + [Theory] + [MemberData(nameof(GetHashCode_InputsAreNotEqualCases))] + public static void Test_GetHashCode_InputsAreNotEqual_ExpectHashCodesAreNotEqual(CaseParamOfImmutableArrayNullable input1, CaseParamOfImmutableArrayNullable input2) + { + var comparer = BuildComparer(); + var hashCode1 = comparer.GetHashCode(input1.Items); + var hashCode2 = comparer.GetHashCode(input2.Items); + Assert.NotStrictEqual(hashCode1, hashCode2); + } + [Theory] [MemberData(nameof(InputsAreEqualCases))] public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfImmutableArrayNullable input1, CaseParamOfImmutableArrayNullable input2) @@ -43,8 +53,8 @@ public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfImmutableArr } [Theory] - [MemberData(nameof(InputsAreNotEqualCases))] - public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfImmutableArrayNullable input1, CaseParamOfImmutableArrayNullable input2) + [MemberData(nameof(Equals_InputsAreNotEqualCases))] + public static void Test_Equals_InputsAreNotEqual_ExpectFalse(CaseParamOfImmutableArrayNullable input1, CaseParamOfImmutableArrayNullable input2) { var comparer = BuildComparer(); var actualEquals = comparer.Equals(input1.Items, input2.Items); @@ -53,11 +63,15 @@ public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfImmutable public static TheoryData, CaseParamOfImmutableArrayNullable> InputsAreEqualCases() => - MapEqualsCases(CaseSources.EqualArrays()); + MapEqualsCases(EqualCaseSource.EqualArrays()); + + public static TheoryData, CaseParamOfImmutableArrayNullable> Equals_InputsAreNotEqualCases() + => + MapEqualsCases(NotEqualCaseSource_Equals.NotEqualArrays()); - public static TheoryData, CaseParamOfImmutableArrayNullable> InputsAreNotEqualCases() + public static TheoryData, CaseParamOfImmutableArrayNullable> GetHashCode_InputsAreNotEqualCases() => - MapEqualsCases(CaseSources.NotEqualArrays()); + MapEqualsCases(NotEqualCaseSource_GetHashCode.NotEqualArrays()); private static TheoryData, CaseParamOfImmutableArrayNullable> MapEqualsCases( IEnumerable<(T[]? X, T[]? Y)> cases) diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/List/ListEqualityComparer_IList_TestsBase.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/List/ListEqualityComparer_IList_TestsBase.cs index b7a6f79..b5f9a5f 100644 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/List/ListEqualityComparer_IList_TestsBase.cs +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/List/ListEqualityComparer_IList_TestsBase.cs @@ -24,6 +24,16 @@ public static void Test_GetHashCode_InputsAreEqual_ExpectHashCodesAreEqual(CaseP Assert.StrictEqual(hashCode1, hashCode2); } + [Theory] + [MemberData(nameof(GetHashCode_InputsAreNotEqualCases))] + public static void Test_GetHashCode_InputsAreNotEqual_ExpectHashCodesAreNotEqual(CaseParamOfIList input1, CaseParamOfIList input2) + { + var comparer = BuildComparer(); + var hashCode1 = comparer.GetHashCode(input1.Items); + var hashCode2 = comparer.GetHashCode(input2.Items); + Assert.NotStrictEqual(hashCode1, hashCode2); + } + [Theory] [MemberData(nameof(InputsAreEqualCases))] public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfIList input1, CaseParamOfIList input2) @@ -34,8 +44,8 @@ public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfIList inp } [Theory] - [MemberData(nameof(InputsAreNotEqualCases))] - public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfIList input1, CaseParamOfIList input2) + [MemberData(nameof(Equals_InputsAreNotEqualCases))] + public static void Test_Equals_InputsAreNotEqual_ExpectFalse(CaseParamOfIList input1, CaseParamOfIList input2) { var comparer = BuildComparer(); var actualEquals = comparer.Equals(input1.Items, input2.Items); @@ -44,11 +54,15 @@ public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfIList public static TheoryData, CaseParamOfIList> InputsAreEqualCases() => - MapEqualsCases(CaseSources.EqualArrays()); + MapEqualsCases(EqualCaseSource.EqualArrays()); + + public static TheoryData, CaseParamOfIList> Equals_InputsAreNotEqualCases() + => + MapEqualsCases(NotEqualCaseSource_Equals.NotEqualArrays()); - public static TheoryData, CaseParamOfIList> InputsAreNotEqualCases() + public static TheoryData, CaseParamOfIList> GetHashCode_InputsAreNotEqualCases() => - MapEqualsCases(CaseSources.NotEqualArrays()); + MapEqualsCases(NotEqualCaseSource_GetHashCode.NotEqualArrays()); private static TheoryData, CaseParamOfIList> MapEqualsCases( IEnumerable<(T[]? X, T[]? Y)> cases) diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/List/ListEqualityComparer_List_TestsBase.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/List/ListEqualityComparer_List_TestsBase.cs index c17f5af..1c14c15 100644 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/List/ListEqualityComparer_List_TestsBase.cs +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/List/ListEqualityComparer_List_TestsBase.cs @@ -24,6 +24,16 @@ public static void Test_GetHashCode_InputsAreEqual_ExpectHashCodesAreEqual(CaseP Assert.StrictEqual(hashCode1, hashCode2); } + [Theory] + [MemberData(nameof(GetHashCode_InputsAreNotEqualCases))] + public static void Test_GetHashCode_InputsAreNotEqual_ExpectHashCodesAreNotEqual(CaseParamOfList input1, CaseParamOfList input2) + { + var comparer = BuildComparer(); + var hashCode1 = comparer.GetHashCode(input1.Items); + var hashCode2 = comparer.GetHashCode(input2.Items); + Assert.NotStrictEqual(hashCode1, hashCode2); + } + [Theory] [MemberData(nameof(InputsAreEqualCases))] public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfList input1, CaseParamOfList input2) @@ -34,8 +44,8 @@ public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfList inpu } [Theory] - [MemberData(nameof(InputsAreNotEqualCases))] - public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfList input1, CaseParamOfList input2) + [MemberData(nameof(Equals_InputsAreNotEqualCases))] + public static void Test_Equals_InputsAreNotEqual_ExpectFalse(CaseParamOfList input1, CaseParamOfList input2) { var comparer = BuildComparer(); var actualEquals = comparer.Equals(input1.Items, input2.Items); @@ -44,11 +54,15 @@ public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfList i public static TheoryData, CaseParamOfList> InputsAreEqualCases() => - MapEqualsCases(CaseSources.EqualArrays()); + MapEqualsCases(EqualCaseSource.EqualArrays()); + + public static TheoryData, CaseParamOfList> Equals_InputsAreNotEqualCases() + => + MapEqualsCases(NotEqualCaseSource_Equals.NotEqualArrays()); - public static TheoryData, CaseParamOfList> InputsAreNotEqualCases() + public static TheoryData, CaseParamOfList> GetHashCode_InputsAreNotEqualCases() => - MapEqualsCases(CaseSources.NotEqualArrays()); + MapEqualsCases(NotEqualCaseSource_GetHashCode.NotEqualArrays()); private static TheoryData, CaseParamOfList> MapEqualsCases( IEnumerable<(T[]? X, T[]? Y)> cases) diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ReadOnlyList/ReadOnlyListEqualityComparer_TestsBase.cs b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ReadOnlyList/ReadOnlyListEqualityComparer_TestsBase.cs index 06ff7c1..389602a 100644 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ReadOnlyList/ReadOnlyListEqualityComparer_TestsBase.cs +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers.Tests/ReadOnlyList/ReadOnlyListEqualityComparer_TestsBase.cs @@ -30,6 +30,16 @@ public static void Test_GetHashCode_InputsAreEqual_ExpectHashCodesAreEqual(CaseP Assert.StrictEqual(hashCode1, hashCode2); } + [Theory] + [MemberData(nameof(GetHashCode_InputsAreNotEqualCases))] + public static void Test_GetHashCode_InputsAreNotEqual_ExpectHashCodesAreNotEqual(CaseParamOfIReadOnlyList input1, CaseParamOfIReadOnlyList input2) + { + var comparer = BuildComparer(); + var hashCode1 = comparer.GetHashCode(input1.Items); + var hashCode2 = comparer.GetHashCode(input2.Items); + Assert.NotStrictEqual(hashCode1, hashCode2); + } + [Theory] [MemberData(nameof(InputsAreEqualCases))] public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfIReadOnlyList input1, CaseParamOfIReadOnlyList input2) @@ -40,8 +50,8 @@ public static void Test_Equals_InputsAreEqual_ExpectTrue(CaseParamOfIReadOnlyLis } [Theory] - [MemberData(nameof(InputsAreNotEqualCases))] - public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfIReadOnlyList input1, CaseParamOfIReadOnlyList input2) + [MemberData(nameof(Equals_InputsAreNotEqualCases))] + public static void Test_Equals_InputsAreNotEqual_ExpectFalse(CaseParamOfIReadOnlyList input1, CaseParamOfIReadOnlyList input2) { var comparer = BuildComparer(); var actualEquals = comparer.Equals(input1.Items, input2.Items); @@ -74,11 +84,15 @@ public static void Test_Equals_InputsAreNotEqual_ExpectTrue(CaseParamOfIReadOnly public static TheoryData, CaseParamOfIReadOnlyList> InputsAreEqualCases() => - MapEqualsCases(CaseSources.EqualArrays()); + MapEqualsCases(EqualCaseSource.EqualArrays()); + + public static TheoryData, CaseParamOfIReadOnlyList> Equals_InputsAreNotEqualCases() + => + MapEqualsCases(NotEqualCaseSource_Equals.NotEqualArrays()); - public static TheoryData, CaseParamOfIReadOnlyList> InputsAreNotEqualCases() + public static TheoryData, CaseParamOfIReadOnlyList> GetHashCode_InputsAreNotEqualCases() => - MapEqualsCases(CaseSources.NotEqualArrays()); + MapEqualsCases(NotEqualCaseSource_GetHashCode.NotEqualArrays()); private static ReadOnlyListEqualityComparer BuildComparer() => diff --git a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers/Collections.Generic.EqualityComparers.csproj b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers/Collections.Generic.EqualityComparers.csproj index 83b7289..1ffd60e 100644 --- a/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers/Collections.Generic.EqualityComparers.csproj +++ b/src/collections-generic-equalitycomparers/Collections.Generic.EqualityComparers/Collections.Generic.EqualityComparers.csproj @@ -15,11 +15,11 @@ https://github.com/pfpack/pfpack-collections-generic pfpack Andrei Sergeev, Pavel Moskovoy - Copyright © 2022-2023 Andrei Sergeev, Pavel Moskovoy + Copyright © 2022-2025 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Generic Collections.EqualityComparers is a core library for .NET consisting of collection value equality comparers. System.Collections.Generic PrimeFuncPack.Collections.Generic.EqualityComparers - 1.0.2-rc.1 + 1.0.2 diff --git a/src/collections-generic/Collections.Generic/Collections.Generic.csproj b/src/collections-generic/Collections.Generic/Collections.Generic.csproj index c98fc64..358c658 100644 --- a/src/collections-generic/Collections.Generic/Collections.Generic.csproj +++ b/src/collections-generic/Collections.Generic/Collections.Generic.csproj @@ -15,11 +15,11 @@ https://github.com/pfpack/pfpack-collections-generic pfpack Andrei Sergeev, Pavel Moskovoy - Copyright © 2022-2023 Andrei Sergeev, Pavel Moskovoy + Copyright © 2022-2025 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Generic Collections is a core library pack for .NET consisting of collection extensions such as collection value equality comparers. System.Collections.Generic PrimeFuncPack.Collections.Generic - 1.0.2-rc.1 + 1.0.2 @@ -34,7 +34,7 @@ - +