2using Microsoft.VisualStudio.TestTools.UnitTesting;
4using System.Threading.Tasks;
16 var diagnostics = analyzer.SupportedDiagnostics;
17 Assert.AreEqual(1, diagnostics.Length);
19 var diagnostic = diagnostics[0];
20 Assert.AreEqual(Constants.AnalyzerIdentifiers.FindBusinessObjectCreation, diagnostic.Id,
21 nameof(DiagnosticDescriptor.Id));
22 Assert.AreEqual(FindBusinessObjectCreationConstants.Title, diagnostic.Title.ToString(),
23 nameof(DiagnosticDescriptor.Title));
24 Assert.AreEqual(FindBusinessObjectCreationConstants.Message, diagnostic.MessageFormat.ToString(),
25 nameof(DiagnosticDescriptor.MessageFormat));
26 Assert.AreEqual(Constants.Categories.Usage, diagnostic.Category,
27 nameof(DiagnosticDescriptor.Category));
28 Assert.AreEqual(DiagnosticSeverity.Error, diagnostic.DefaultSeverity,
29 nameof(DiagnosticDescriptor.DefaultSeverity));
31 diagnostic.HelpLinkUri,
32 nameof(DiagnosticDescriptor.HelpLinkUri));
49 code, Array.Empty<
string>());
59public class A : BusinessBase<A> { }
61public class B : ObjectFactory
69 code, Array.Empty<
string>());
79public class A : BusinessBase<A> { }
89 code,
new[] { Constants.AnalyzerIdentifiers.FindBusinessObjectCreation });
void VerifySupportedDiagnostics()
async Task AnalyzeWhenConstructorIsOnBusinessObjectOutsideOfObjectFactory()
async Task AnalyzeWhenConstructorIsNotOnBusinessObject()
async Task AnalyzeWhenConstructorIsOnBusinessObjectWithinObjectFactory()