It happens to me a lot that when I create tests I put [Fact] / [Theory] but I forget to put the one of the category: [UnitTest], [IntegrationTest], ...
As a result, I end up having many tests without category and when I run dotnet test by CI indicating for example Category!=Benchmark&Category!=IntegrationTest I end up having integration tests included because the category attribute is not included.
I believe that all inherit from BaseAttribute, so it would need an analyzer that looks for methods with the attribute [Fact] / [Theory] and to see if it includes some that inherit from BaseAttribute and if it is not thus to emit a diagnostic.
It happens to me a lot that when I create tests I put [Fact] / [Theory] but I forget to put the one of the category: [UnitTest], [IntegrationTest], ...
As a result, I end up having many tests without category and when I run dotnet test by CI indicating for example Category!=Benchmark&Category!=IntegrationTest I end up having integration tests included because the category attribute is not included.
I believe that all inherit from BaseAttribute, so it would need an analyzer that looks for methods with the attribute [Fact] / [Theory] and to see if it includes some that inherit from BaseAttribute and if it is not thus to emit a diagnostic.