public void VerifySupportedDiagnostics() { var analyzer = new EvaluateManagedBackingFieldsAnalayzer(); var diagnostics = analyzer.SupportedDiagnostics; Assert.AreEqual(1, diagnostics.Length); var diagnostic = diagnostics.Single(_ => _.Id == EvaluateManagedBackingFieldsAnalayzerConstants.DiagnosticId); Assert.AreEqual(diagnostic.Title.ToString(), EvaluateManagedBackingFieldsAnalayzerConstants.Title, nameof(DiagnosticDescriptor.Title)); Assert.AreEqual(diagnostic.MessageFormat.ToString(), EvaluateManagedBackingFieldsAnalayzerConstants.Message, nameof(DiagnosticDescriptor.MessageFormat)); Assert.AreEqual(diagnostic.Category, EvaluateManagedBackingFieldsAnalayzerConstants.Category, nameof(DiagnosticDescriptor.Category)); Assert.AreEqual(diagnostic.DefaultSeverity, DiagnosticSeverity.Error, nameof(DiagnosticDescriptor.DefaultSeverity)); }
public void VerifySupportedDiagnostics() { var analyzer = new EvaluateManagedBackingFieldsAnalayzer(); var diagnostics = analyzer.SupportedDiagnostics; Assert.AreEqual(1, diagnostics.Length); var diagnostic = diagnostics.Single(_ => _.Id == Constants.AnalyzerIdentifiers.EvaluateManagedBackingFields); Assert.AreEqual(EvaluateManagedBackingFieldsAnalayzerConstants.Title, diagnostic.Title.ToString(), nameof(DiagnosticDescriptor.Title)); Assert.AreEqual(EvaluateManagedBackingFieldsAnalayzerConstants.Message, diagnostic.MessageFormat.ToString(), nameof(DiagnosticDescriptor.MessageFormat)); Assert.AreEqual(Constants.Categories.Usage, diagnostic.Category, nameof(DiagnosticDescriptor.Category)); Assert.AreEqual(DiagnosticSeverity.Error, diagnostic.DefaultSeverity, nameof(DiagnosticDescriptor.DefaultSeverity)); }
public void VerifySupportedDiagnostics() { var analyzer = new EvaluateManagedBackingFieldsAnalayzer(); var diagnostics = analyzer.SupportedDiagnostics; Assert.AreEqual(1, diagnostics.Length); var diagnostic = diagnostics.Single(_ => _.Id == Constants.AnalyzerIdentifiers.EvaluateManagedBackingFields); Assert.AreEqual(EvaluateManagedBackingFieldsAnalayzerConstants.Title, diagnostic.Title.ToString(), nameof(DiagnosticDescriptor.Title)); Assert.AreEqual(EvaluateManagedBackingFieldsAnalayzerConstants.Message, diagnostic.MessageFormat.ToString(), nameof(DiagnosticDescriptor.MessageFormat)); Assert.AreEqual(Constants.Categories.Usage, diagnostic.Category, nameof(DiagnosticDescriptor.Category)); Assert.AreEqual(DiagnosticSeverity.Error, diagnostic.DefaultSeverity, nameof(DiagnosticDescriptor.DefaultSeverity)); Assert.AreEqual(HelpUrlBuilder.Build(Constants.AnalyzerIdentifiers.EvaluateManagedBackingFields, nameof(EvaluateManagedBackingFieldsAnalayzer)), diagnostic.HelpLinkUri, nameof(DiagnosticDescriptor.HelpLinkUri)); }