fluentassertions / fluentassertions.analyzers

Analyzers based on the FluentAssertions best practices docs
https://www.fluentassertions.com/tips
MIT License
137 stars 21 forks source link

Fix missing parenthesis after applying XUnit code fixes #248

Closed jairbubbles closed 11 months ago

jairbubbles commented 11 months ago

After applying code fixes to transform XUnit asserts to fluent assertions I got some compilation errors. Some parenthesis were missing when the expression tested was complex.

Note: The tests were not properly testing the code source after the code fix is applied, I re-enabled it but some tests were failing so I added a '#if TO_BE_FIXED

Meir017 commented 11 months ago

@jairbubbles Thank you for your contribution! version 0.27.0 is released with your changes!

jairbubbles commented 11 months ago

Thanks, for your information I stumbled on https://github.com/meziantou/Meziantou.FluentAssertionsAnalyzers which also supports NUnit test migration.

Also, one cool thing is that the code fixes are already reported on a same ID so it's easier to fix all at once:

dotnet format analyzers --diagnostics MFA003