Skip to main content

Instantly start coding roslyn analyzer tests, without having to prepare a new derived class for every test flavor.

Total Downloads
6.4K
6,377
Published
Jul 4, 2026
4mo ago

Get Started

dotnet add package AnalyzerTesting.CSharp.Extensions --version 1.2.2
ProductVersions
.NET Standard
netstandard2.0

README

Roslyn analyzer testing extensions

Instantly start coding roslyn analyzer tests, without having to prepare a new derived class for every test flavor.

This project provides solution transforms and extension methods to simpify testing of roslyn analyzers and to ease configuration of the compilation like adding references or changing language version.

It also provides base classes to test incremental generators and diagnostic suppressors with "Microsoft.CodeAnalysis.CSharp.Analyzer.Testing version 1.1.1 and Microsoft.CodeAnalysis.CSharp.Workspaces >= 4.3.1

  • Predefined solution transforms to fine tune the test when using object initializer notation
  • Extension methods to configure the test using fluent notation
  • An IncrementalSourceGenerator test to test incremental source generators with "Microsoft.CodeAnalysis.CSharp.Analyzer.Testing version 1.1.1
  • An IncrementalSourceGenerator test that supports snapshot testing
  • A DiagnosticSuppressor test to test diagnostic suppressors with Microsoft.CodeAnalysis.CSharp.Workspaces >= 4.3.1

Downloads by Version

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.