2using System.Threading.Tasks;
4using Microsoft.VisualStudio.TestTools.UnitTesting;
15 var diagnostics = analyzer.SupportedDiagnostics;
16 Assert.AreEqual(1, diagnostics.Length);
18 var diagnostic = diagnostics[0];
19 Assert.AreEqual(Constants.AnalyzerIdentifiers.DoesChildOperationHaveRunLocal, diagnostic.Id,
20 nameof(DiagnosticDescriptor.Id));
21 Assert.AreEqual(DoesChildOperationHaveRunLocalAnalyzerConstants.Title, diagnostic.Title.ToString(),
22 nameof(DiagnosticDescriptor.Title));
23 Assert.AreEqual(DoesChildOperationHaveRunLocalAnalyzerConstants.Message, diagnostic.MessageFormat.ToString(),
24 nameof(DiagnosticDescriptor.MessageFormat));
25 Assert.AreEqual(Constants.Categories.Usage, diagnostic.Category,
26 nameof(DiagnosticDescriptor.Category));
27 Assert.AreEqual(DiagnosticSeverity.Warning, diagnostic.DefaultSeverity,
28 nameof(DiagnosticDescriptor.DefaultSeverity));
30 diagnostic.HelpLinkUri,
31 nameof(DiagnosticDescriptor.HelpLinkUri));
37 var code =
"public class A { }";
39 code, Array.Empty<
string>());
48public class A : BusinessBase<A>
52 private void Fetch() { }
55 code, Array.Empty<
string>());
64public class A : BusinessBase<A>
67 private void FetchChild() { }
70 code, Array.Empty<
string>());
79public class A : BusinessBase<A>
83 private void FetchChild() { }
86 code,
new[] { Constants.AnalyzerIdentifiers.DoesChildOperationHaveRunLocal });
async Task AnalyzeWhenClassIsMobileObjectAndChildOperationHasRunLocal()
async Task AnalyzeWhenClassIsNotMobileObject()
async Task AnalyzeWhenClassIsMobileObjectAndChildOperationDoesNotHaveRunLocal()
void VerifySupportedDiagnostics()
async Task AnalyzeWhenClassIsMobileObjectAndRootOperationHasRunLocal()