/AnalyzerConvention

"Analyzer with Code Fix" project template with ConventionCodeFixVerifier test project

Primary LanguageC#MIT LicenseMIT

AnalyzerProject.Convention

"Analyzer with Code Fix" project template with ConventionCodeFixVerifier test project

How to use

Install the template:

dotnet new -i AnalyzerProject.Convention

NuGet: https://www.nuget.org/packages/AnalyzerProject.Convention/

Create a new project:

dotnet new AnalyzerConvention

Contents

This project template contains:

ConventionCodeFixVerifier

Extends the CodeFixVerifier class in the "Analyzer with Code Fix" project template to read test cases from .csx files by naming convention.

Convention

  • Put the following files in /DataSource/[test class name]/[test method name] folder
    • *.cs in Source folder: inputs for your Analyzer/Code Fix
    • *.json in Diagnostic folder: diagnostic results of the Source.cs by your Analyzer
    • *.cs in Expected{n} folder: output source codes by the n-th action of your Code Fix

Sample Screenshot