Skip to content

Commit

Permalink
Cover new dictionary code
Browse files Browse the repository at this point in the history
  • Loading branch information
atifaziz committed Nov 3, 2022
1 parent e18debb commit 8a8baf5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions MoreLinq.Test/CountByTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}

0 comments on commit 8a8baf5

Please sign in to comment.