-
Notifications
You must be signed in to change notification settings - Fork 32
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
[NUnit2045] Incorrect refactoring #541
Comments
Thanks for the report @MaceWindu When more than two statements can be merged, the Analyzer raises multiple suggestions. Assert.That(handler.Build(null), Is.EqualTo(null));
Assert.That(handler.Build(new object()), Is.EqualTo(0d));
Assert.That(handler.Build(new { }), Is.EqualTo(0d)); First step: Assert.That(handler.Build(null), Is.EqualTo(null));
Assert.Multiple(() =>
{
Assert.That(handler.Build(new object()), Is.EqualTo(0d));
Assert.That(handler.Build(new { }), Is.EqualTo(0d));
} Second step then combines these in another I will see if I can either limit the amount of suggestions to the first line only or ensure that applying all fixes does the longest fix. |
When single refactoring applied, code refactored properly, but when user selects to apply it to some scope, e.g. Document, it produce non-compilable results. Note duplicate
Assert.Multiple(() =>
linesThe text was updated successfully, but these errors were encountered: