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

Analyzer for Should().Equals()? #94

Closed
bordecal opened this issue Mar 5, 2020 · 2 comments · Fixed by #95
Closed

Analyzer for Should().Equals()? #94

bordecal opened this issue Mar 5, 2020 · 2 comments · Fixed by #95

Comments

@bordecal
Copy link

bordecal commented Mar 5, 2020

Use of actual.Should().Equals(expected) (which is not an assertion at all) is perhaps the single most serious recurrent error I tend to see with FluentAssertions use. Would an analyzer to detect this construct fit with the goals for this project?

N.B.: To be honest, the fact that there isn't already an analyzer for this (or apparently even an existing issue requesting its addition) strikes me as sufficiently odd that I'm wondering if I'm missing some other mechanism that would detect this problem. If such a beastie does exist, an analyzer would presumably be unnecessary, but a documentation update to increase its visibility might be helpful...

@wilka
Copy link

wilka commented Mar 9, 2020

@bordecal it's not just you, I've seen this a lot as well.

Instead of opening an issue about this I started trying to add it myself (I thought it would be more helpful to send a PR than just open an issue), but I got distracted before getting very far so it's been stuck on my todo list for ages.

I should have opened an issue about it a long time ago :)

@Meir017
Copy link
Member

Meir017 commented Mar 9, 2020

This makes a lot of sense. I just started this project based on the fluentassertions best practices

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

Successfully merging a pull request may close this issue.

3 participants