private static void TestDocumentFactory() { DocumentFactory.CreateDocuments(_filePath, "g:\\temp\\", "Brad Marshall", 2, OutputType.SingleDocument); DocumentFactory.CreateDocuments(_filePath, "g:\\temp\\", "Brad Marshall", 3, OutputType.SingleDocument); DocumentFactory.CreateDocuments(_filePath, "g:\\temp\\", "Brad Marshall", 4, OutputType.SingleDocument); }
/// <summary> /// Given classes in the form of strings, their language, and an IDiagnosticAnalyzer to apply to it, return the diagnostics found in the string after converting it to a document. /// </summary> /// <param name="sources">Classes in the form of strings</param> /// <param name="language">The language the source classes are in</param> /// <param name="analyzer">The analyzer to be run on the sources</param> /// <returns>An IEnumerable of Diagnostics that surfaced in the source code, sorted by Location</returns> public static Diagnostic[] GetSortedDiagnostics(this DiagnosticAnalyzer analyzer, string language, string[] sources) { return(GetSortedDiagnosticsFromDocuments(analyzer, DocumentFactory.CreateDocuments(sources, language))); }