roslyn-analyzers
roslyn-analyzers copied to clipboard
Unit Tests for AvoidRedundantSwitch
Interestingly, SonarCloud code coverage was low. It turns out GeneratedCodeAnalysisFlags.None seemed to have different behavior on our build machine running .NET7. I then upgraded my local Visual Studio from 17.3 to 17.4, and I observed the same new behavior. I then found a machine with 17.2, but not .net3.1 (and installing .net3.1 still didn't allow my to run Unit Tests - I stopped investigating). But 17.2 with net6 (and changing UnitTest csproj to .net6) also exhibited new/good GeneratedCodeAnalysisFlags behavior. But I'm still not entirely convinced it's safe to remove the GeneratedCodeDetector class yet, in case an older client is out there and reliant on it. Instead, I allowed for injecting GeneratedCodeAnalysisFlags behavior so that the Unit Tests will provide coverage.
Please keep supporting older version of Visual Studio, there are still people out there on 2019