2using Microsoft.VisualStudio.TestTools.UnitTesting;
5using System.Threading.Tasks;
16 var diagnostics = analyzer.SupportedDiagnostics;
17 Assert.AreEqual(1, diagnostics.Length);
19 var diagnostic = diagnostics.Single(_ => _.Id == Constants.AnalyzerIdentifiers.IsOperationAttributeUsageCorrect);
20 Assert.AreEqual(EvaluateOperationAttributeUsageAnalyzerConstants.Title, diagnostic.Title.ToString(),
21 nameof(DiagnosticDescriptor.Title));
22 Assert.AreEqual(EvaluateOperationAttributeUsageAnalyzerConstants.Message, diagnostic.MessageFormat.ToString(),
23 nameof(DiagnosticDescriptor.MessageFormat));
24 Assert.AreEqual(Constants.Categories.Usage, diagnostic.Category,
25 nameof(DiagnosticDescriptor.Category));
26 Assert.AreEqual(DiagnosticSeverity.Error, diagnostic.DefaultSeverity,
27 nameof(DiagnosticDescriptor.DefaultSeverity));
29 diagnostic.HelpLinkUri,
30 nameof(DiagnosticDescriptor.HelpLinkUri));
42 private void Fetch() { }
45 code,
new[] { Constants.AnalyzerIdentifiers.IsOperationAttributeUsageCorrect });
60 private static void Fetch() { }
63 code,
new[] { Constants.AnalyzerIdentifiers.IsOperationAttributeUsageCorrect });
78 private void Fetch() { }
81 code, Array.Empty<
string>());
async Task AnalyzeWhenTypeIsStereotypeAndOperationIsStatic()
async Task AnalyzeWhenTypeIsNotStereotype()
void VerifySupportedDiagnostics()
async Task AnalyzeWhenTypeIsStereotypeAndOperationIsInstance()