dotnet / roslyn-analyzers

MIT License
1.6k stars 468 forks source link

Unit Tests testFixAllScope related problem #2237

Open TKharaishvili opened 5 years ago

TKharaishvili commented 5 years ago

While working on this PR - https://github.com/dotnet/roslyn-analyzers/pull/2234 several problematic unit tests were revealed, 20 to be exact, all of which have for now been silenced by passing testFixAllScope: null.

They all need to be examined. The 2nd commit of the PR documents all those problematic unit tests.

Evangelink commented 4 years ago

@sharwell Do you think this issue is still relevant with the recent move to the sdk test framework?

sharwell commented 4 years ago

@Evangelink Yes, these cases now show up as tests with NumberOfFixAllIterations set to something greater than 1. For example:

https://github.com/dotnet/roslyn-analyzers/blob/79c2638f54b9e7ef0a3954cc838ec4c13ea63c1f/src/NetAnalyzers/UnitTests/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/DefineAccessorsForAttributeArgumentsTests.Fixer.cs#L115

Evangelink commented 4 years ago

Here is the list of fixers with NumberOfFixAllIterations set to something greater than 1: