Skip to content
This repository was archived by the owner on Aug 26, 2026. It is now read-only.
This repository was archived by the owner on Aug 26, 2026. It is now read-only.

How to test SourceGenerators using Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing? #1217

Description

@Doodeletion

I could not not find any documentation on how to use Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing. I only found https://github.com/dotnet/roslyn-sdk/blob/main/src/Microsoft.CodeAnalysis.Testing/README.md which covers testing analyzers.

Looking at the classes my best guess is that you are supposed to have your test classes extend SourceGeneratorTest, but I don't really know what that would do nor do I know what type parameters to pass in (as TVerifier).

Could anyone point me in the right direction or to some documentation?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions