public async void ContentDialogCodeAnalyzerTest(string documentPath)
        {
            using var workspace = new AdhocWorkspace();
            var diagnostics = await workspace.GetDiagnosticsAsync(documentPath, ImmutableList.Create(WinUIContentDialogAnalyzer.DiagnosticId), true).ConfigureAwait(false);

            AssertDiagnosticsCorrect(diagnostics, ExpectedDiagnostics[documentPath]);
        }
        public async void ResourceManagerAnalyzerTest(string documentPath)
        {
            using var workspace = new AdhocWorkspace();
            var diagnostics = await workspace.GetDiagnosticsAsync(documentPath, ImmutableList.Create(WinUIMRTResourceManagerAnalyzer.ResourceManagerAPIDiagnosticId,
                                                                                                     WinUIMRTResourceManagerAnalyzer.ResourceContextAPIDiagnosticId), true).ConfigureAwait(false);

            AssertDiagnosticsCorrect(diagnostics, ExpectedDiagnostics[documentPath]);
        }
        public async void AppWindowAnalyzerTest(string documentPath)
        {
            using var workspace = new AdhocWorkspace();
            var diagnostics = await workspace.GetDiagnosticsAsync(documentPath, ImmutableList.Create(WinUIAppWindowAnalyzer.DiagnosticIdAppWindowType,
                                                                                                     WinUIAppWindowAnalyzer.DiagnosticIdAppWindowVarType, WinUIAppWindowAnalyzer.DiagnosticIdAppWindowMember), true).ConfigureAwait(false);

            AssertDiagnosticsCorrect(diagnostics, ExpectedDiagnostics[documentPath]);
        }
예제 #4
0
 public static Task <IEnumerable <Diagnostic> > GetDiagnosticsAsync(this AdhocWorkspace workspace, string documentPath, IEnumerable <string> diagnosticIds, bool isFramework)
 {
     return(workspace.GetDiagnosticsAsync(Language.CSharp, documentPath, isFramework, diagnosticIds));
 }