Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CollectionAssert.AreEqual fails for list of strings using IEqualityComparer following #3275 #3822

Open
Smenus opened this issue Sep 12, 2024 · 0 comments

Comments

@Smenus
Copy link

Smenus commented Sep 12, 2024

Describe the bug

Following #3275, comparing two lists of strings (List<string>) fails when an IEqualityComparer is passed, with the intention of ignoring case for example.

Steps To Reproduce

Setup: create a MSTest project. Put following code in a sample test:

List<string> expected = ["one", "two"];
List<string> actual   = ["ONE", "tWo"];

CollectionAssert.AreEqual(expected, actual, StringComparer.OrdinalIgnoreCase);

Expected behavior

Test passes.

Actual behavior

Test fails.

Additional context

From looking at the code, I expect it's because strings are IEnumerable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants