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

Enable FixAll testing by default for all code fix unit tests #1420

Closed
mavasani opened this issue Nov 30, 2017 · 2 comments
Closed

Enable FixAll testing by default for all code fix unit tests #1420

mavasani opened this issue Nov 30, 2017 · 2 comments

Comments

@mavasani
Copy link
Contributor

No description provided.

@mavasani mavasani added this to the 15.5.Later milestone Nov 30, 2017
@mavasani mavasani self-assigned this Nov 30, 2017
mavasani added a commit to mavasani/roslyn that referenced this issue Nov 30, 2017
Well known batch fixer expects a MEF exported IDocumentTextDifferencingService, but we only have one in the EditorFeatures layer.
We already have a simple default differencing service in the workspace, this change exports it at the default service layer.
This change unblocks enabling FixAll testing in roslyn-analyzers repo: dotnet/roslyn-analyzers#1420
@mavasani
Copy link
Contributor Author

@ivanbasov As you mentioned a couple of days ago, we are unable to execute well known batch fixer in our unit tests. Underlying reason is captured here: dotnet/roslyn#23492.

mavasani added a commit to mavasani/roslyn-analyzers that referenced this issue Nov 30, 2017
By default, VerifyFix method now tests both iterative code fix application and iterative FixAll application.
We still have the VerifyFixAll helper method for tests that want to verify single FixAll application.
Fixes dotnet#1420
@mavasani mavasani modified the milestones: 15.5.Later, 15.6 Dec 12, 2017
@jinujoseph jinujoseph modified the milestones: 15.6, 15.7 Feb 20, 2018
@jinujoseph jinujoseph modified the milestones: 15.7, 15.8 Apr 25, 2018
dotpaul pushed a commit to dotpaul/roslyn-analyzers that referenced this issue Sep 26, 2018
All the VerifyXXXFix test helpers now take an optional FixAllScope, which defaults to document/project based on whether the test verifies a single document or multiple documents. After validating the individual diagnostic code fix, the test framework also invokes the FixAll and verifies the result is identical.

For unit tests which have multiple fixable diagnostics in the original source code, they should explicitly disable FixAll testing in the VerifyXXXFix call by passing a null FixAllScope and have a separate FixAll test with appropriate baseline.

For code fixers which have no FixAll support, they can override a property to turn off FixAll testing for all unit tests.

Fixes #dotnet#1420
@mavasani
Copy link
Contributor Author

mavasani commented Jul 1, 2019

Done

@mavasani mavasani closed this as completed Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants