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

Create Analyzer/Fixer for Assert.Single #186

Merged
merged 10 commits into from
Aug 24, 2024

Conversation

RieBi
Copy link
Contributor

@RieBi RieBi commented Jul 29, 2024

This is intended to solve the final part of xunit/xunit#1510 (if I haven't missed anything).

It maps the single-argument call to Assert.Single with linq where expression, and suggests to change it to two-argument call:

- Assert.Single(list.Where(f => f > 0));
+ Assert.Single(list, f => f > 0);

@RieBi
Copy link
Contributor Author

RieBi commented Aug 7, 2024

I would love to receive feedback if there's anything wrong @bradwilson

@bradwilson
Copy link
Member

Sorry, I will get to this but I haven't had time yet. My apologies.

@bradwilson
Copy link
Member

Thanks, everything looks great! I made a couple minor edits.

@bradwilson bradwilson merged commit 70c3fc5 into xunit:main Aug 24, 2024
5 checks passed
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 this pull request may close these issues.

2 participants