2using Microsoft.VisualStudio.TestTools.UnitTesting;
4using System.Threading.Tasks;
15 var diagnostics = analyzer.SupportedDiagnostics;
16 Assert.AreEqual(1, diagnostics.Length);
18 var diagnostic = diagnostics[0];
19 Assert.AreEqual(Constants.AnalyzerIdentifiers.IsBusinessObjectSerializable, diagnostic.Id,
20 nameof(DiagnosticDescriptor.Id));
21 Assert.AreEqual(IsBusinessObjectSerializableConstants.Title, diagnostic.Title.ToString(),
22 nameof(DiagnosticDescriptor.Title));
23 Assert.AreEqual(IsBusinessObjectSerializableConstants.Message, diagnostic.MessageFormat.ToString(),
24 nameof(DiagnosticDescriptor.MessageFormat));
25 Assert.AreEqual(Constants.Categories.Usage, diagnostic.Category,
26 nameof(DiagnosticDescriptor.Category));
27 Assert.AreEqual(DiagnosticSeverity.Error, diagnostic.DefaultSeverity,
28 nameof(DiagnosticDescriptor.DefaultSeverity));
30 diagnostic.HelpLinkUri,
31 nameof(DiagnosticDescriptor.HelpLinkUri));
37 var code =
"public class A { }";
39 code, Array.Empty<
string>());
50public class A : BusinessBase<A>{ }";
52 code, Array.Empty<
string>());
61public class A : BusinessBase<A>{ }";
63 code,
new[] { Constants.AnalyzerIdentifiers.IsBusinessObjectSerializable });
async Task AnalyzeWhenClassIsNotMobileObject()
async Task AnalyzeWhenClassIsMobileObjectAndIsSerializable()
async Task AnalyzeWhenClassIsMobileObjectAndIsNotSerializable()
void VerifySupportedDiagnostics()