Skip to content

Add Roslyn analyzer to ensure that the category attribute is set #43

@bdovaz

Description

@bdovaz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions