using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; namespace CliFx.Analyzers.Tests { public class AnalyzerTestCase { public string Name { get; } public IReadOnlyList TestedDiagnostics { get; } public IReadOnlyList SourceCodes { get; } public AnalyzerTestCase( string name, IReadOnlyList testedDiagnostics, IReadOnlyList sourceCodes) { Name = name; TestedDiagnostics = testedDiagnostics; SourceCodes = sourceCodes; } public AnalyzerTestCase( string name, IReadOnlyList testedDiagnostics, string sourceCode) : this(name, testedDiagnostics, new[] {sourceCode}) { } public AnalyzerTestCase( string name, DiagnosticDescriptor testedDiagnostic, string sourceCode) : this(name, new[] {testedDiagnostic}, sourceCode) { } public override string ToString() => $"{Name} [{string.Join(", ", TestedDiagnostics.Select(d => d.Id))}]"; } }