Skip to content

Fluent testing library for Roslyn incremental generators - verify output files, diagnostics, and caching behavior with simple assertions

Notifications You must be signed in to change notification settings

ANcpLua/Generator.Testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Generator.Testing

Fluent testing for Roslyn incremental generators. example usage

How to:

Caching

await source.ShouldCache<MyGenerator>();

Generated Files

await source.ShouldGenerate<MyGenerator>("Person.g.cs");

Test Diagnostics

await source.ShouldHaveDiagnostic<MyGenerator>("GE0001", DiagnosticSeverity.Info);
await source.ShouldHaveDiagnostic<MyGenerator>("GE0002", DiagnosticSeverity.Warning);
await source.ShouldHaveDiagnostic<MyGenerator>("GE0003"); // Default: Error

Debug (DEBUG builds only)

#if DEBUG
await source.DebugCache<MyGenerator>(); // Throws with detailed caching report
#endif

About

Fluent testing library for Roslyn incremental generators - verify output files, diagnostics, and caching behavior with simple assertions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages