roslyn-sdk
roslyn-sdk copied to clipboard
Improve exception message when VerifyCodeFixAsync(code, code) fails
See https://github.com/dotnet/roslyn-analyzers/pull/4700/files#r558434203
What was the old exception message? Do you have a suggestion for specific improvement?
@sharwell Message:
Microsoft.CodeAnalysis.Testing.Verifiers.EqualWithMessageException : Context: Iterative code fix application
Expected '0' iterations but found '1' iterations.
The scenario was: A codefix is offered with no changes, i.e:

It didn't make sense to me at that time. While now I think it makes sense, it may be confusing to people new to writing analyzers. A more clear message would be something similar to "Expected no codefixes, found a code fix that doesn't change code".