C# Class MvvmCross.CodeAnalysis.Test.DiagnosticVerifier

Class for turning strings into documents and getting the diagnostics on them All methods are static
显示文件 Open project: MvvmCross/MvvmCross

Protected Methods

Method Description
CreateDocument ( MvxTestFileSource fileSources, MvxTestFileSource fileSource ) : Microsoft.CodeAnalysis.Document

Create a Document from a string through creating a project that contains it.

GetDocuments ( MvxTestFileSource fileSources ) : 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.

GetSortedDiagnosticsFromDocuments ( Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer analyzer, Microsoft.CodeAnalysis.Document documents ) : Diagnostic[]

Given an analyzer and a document to apply it to, run the analyzer and gather an array of diagnostics found in it. The returned diagnostics are then ordered by location in the source document.

Private Methods

Method Description
CreateSolution ( MvxTestFileSource fileSources ) : Microsoft.CodeAnalysis.Solution

Create a project using the inputted strings as sources.

GetCorrectObjectModelPath ( string path ) : string
GetProjectId ( MvxTestFileSource fileSource ) : ProjectId
GetSortedDiagnostics ( MvxTestFileSource fileSources, Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer analyzer ) : Diagnostic[]

Given classes in the form of strings, their language, and an IDiagnosticAnlayzer to apply to it, return the diagnostics found in the string after converting it to a document.

IsFromProject ( MvxTestFileSource file, ProjectId projectId ) : bool
SortDiagnostics ( IEnumerable diagnostics ) : Diagnostic[]

Sort diagnostics by location in source document

Method Details

CreateDocument() protected static method

Create a Document from a string through creating a project that contains it.
protected static CreateDocument ( MvxTestFileSource fileSources, MvxTestFileSource fileSource ) : Microsoft.CodeAnalysis.Document
fileSources MvxTestFileSource Classes in the form of MvxTestFileSources
fileSource MvxTestFileSource The file the should be added last, aldo also to be returned
return Microsoft.CodeAnalysis.Document

GetDocuments() protected static method

Given an array of strings as sources and a language, turn them into a project and return the documents and spans of it.
protected static GetDocuments ( MvxTestFileSource fileSources ) : Microsoft.CodeAnalysis.Document[]
fileSources MvxTestFileSource Classes in the form of MvxTestFileSources
return Microsoft.CodeAnalysis.Document[]

GetSortedDiagnosticsFromDocuments() protected static method

Given an analyzer and a document to apply it to, run the analyzer and gather an array of diagnostics found in it. The returned diagnostics are then ordered by location in the source document.
protected static GetSortedDiagnosticsFromDocuments ( Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer analyzer, Microsoft.CodeAnalysis.Document documents ) : Diagnostic[]
analyzer Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer The analyzer to run on the documents
documents Microsoft.CodeAnalysis.Document The Documents that the analyzer will be run on
return Diagnostic[]