Skip to main content
.NETStandard2.0

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

Published
Apr 20, 2023
3y ago
Total Downloads
6.4K
6,377

Install

dotnet add package AnalyzerTesting.CSharp.Extensions --version 1.0.0-beta4
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.0

  • 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.0

Changes from Previous Version

v1.0.0-beta3v1.0.0-beta4
Added Dependencies

Adoption Assessment

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

This version is marked prerelease. Validate its API and upgrade path before production use.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.