diff --git a/MoreLinq.Test/CountByTest.cs b/MoreLinq.Test/CountByTest.cs index 26158260d..ea0e7e8a1 100644 --- a/MoreLinq.Test/CountByTest.cs +++ b/MoreLinq.Test/CountByTest.cs @@ -103,5 +103,17 @@ public void CountByWithSomeNullKeys() KeyValuePair.Create("bar", 2), KeyValuePair.Create("baz", 2)); } + + [Test] + public void CountByWithSomeNullKeysAndEqualityComparer() + { + var result = new[] { "a", "B", null, "c", "A", null, "b", "A" }.CountBy(c => c, StringComparer.OrdinalIgnoreCase); + + result.AssertSequenceEqual( + KeyValuePair.Create("a", 3), + KeyValuePair.Create("B", 2), + KeyValuePair.Create((string)null, 2), + KeyValuePair.Create("c", 1)); + } } }