Метод | Описание | |
---|---|---|
CreateDocument ( string source ) : Microsoft.CodeAnalysis.Document |
Create a Document from a string through creating a project that contains it.
|
|
GetCSharpDiagnosticAnalyzer ( ) : Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer | ||
GetSortedDiagnosticsFromDocuments ( Microsoft.CodeAnalysis.Document documents ) : Diagnostic[] | ||
VerifyDiagnostic ( string source ) : void |
Called to test a C# DiagnosticAnalyzer when applied on the single inputted string as a source Note: input a DiagnosticResult for each Diagnostic expected
|
Метод | Описание | |
---|---|---|
CreateProject ( string sources ) : Microsoft.CodeAnalysis.Project |
Create a project using the inputted strings as sources.
|
|
FormatDiagnostics ( Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer analyzer ) : string |
Helper method to format a Diagnostic into an easily readable string
|
|
GetDocuments ( string sources ) : Microsoft.CodeAnalysis.Document[] |
Given an array of strings as sources and a language, turn them into a project and return the documents and spans of it.
|
|
VerifyDiagnosticResults ( IEnumerable |
Checks each of the actual Diagnostics found and compares them with the corresponding DiagnosticResult in the array of expected results. Diagnostics are considered equal only if the DiagnosticResultLocation, Id, Severity, and Message of the DiagnosticResult match the actual diagnostic.
|
protected static CreateDocument ( string source ) : Microsoft.CodeAnalysis.Document | ||
source | string | Classes in the form of a string |
Результат | Microsoft.CodeAnalysis.Document |
protected GetCSharpDiagnosticAnalyzer ( ) : Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer | ||
Результат | Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer |
protected GetSortedDiagnosticsFromDocuments ( Microsoft.CodeAnalysis.Document documents ) : Diagnostic[] | ||
documents | Microsoft.CodeAnalysis.Document | |
Результат | Diagnostic[] |
protected VerifyDiagnostic ( string source ) : void | ||
source | string | A class in the form of a string to run the analyzer on |
Результат | void |