mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Microsoft.CodeAnalysis;
|
|
|
|
namespace CliFx.Analyzers.Tests
|
|
{
|
|
public class AnalyzerTestCase
|
|
{
|
|
public string Name { get; }
|
|
|
|
public IReadOnlyList<DiagnosticDescriptor> TestedDiagnostics { get; }
|
|
|
|
public IReadOnlyList<string> SourceCodes { get; }
|
|
|
|
public AnalyzerTestCase(
|
|
string name,
|
|
IReadOnlyList<DiagnosticDescriptor> testedDiagnostics,
|
|
IReadOnlyList<string> sourceCodes)
|
|
{
|
|
Name = name;
|
|
TestedDiagnostics = testedDiagnostics;
|
|
SourceCodes = sourceCodes;
|
|
}
|
|
|
|
public AnalyzerTestCase(
|
|
string name,
|
|
IReadOnlyList<DiagnosticDescriptor> 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))}]";
|
|
}
|
|
} |