public void VerifySupportedDiagnostics()
    {
      var analyzer = new IsBusinessObjectSerializableAnalyzer();
      var diagnostics = analyzer.SupportedDiagnostics;
      Assert.AreEqual(1, diagnostics.Length);

      var diagnostic = diagnostics[0];
      Assert.AreEqual(diagnostic.Id, IsBusinessObjectSerializableConstants.DiagnosticId,
        nameof(DiagnosticDescriptor.Id));
      Assert.AreEqual(diagnostic.Title.ToString(), IsBusinessObjectSerializableConstants.Title,
        nameof(DiagnosticDescriptor.Title));
      Assert.AreEqual(diagnostic.MessageFormat.ToString(), IsBusinessObjectSerializableConstants.Message,
        nameof(DiagnosticDescriptor.MessageFormat));
      Assert.AreEqual(diagnostic.Category, IsBusinessObjectSerializableConstants.Category,
        nameof(DiagnosticDescriptor.Category));
      Assert.AreEqual(diagnostic.DefaultSeverity, DiagnosticSeverity.Error,
        nameof(DiagnosticDescriptor.DefaultSeverity));
    }
예제 #2
0
        public void VerifySupportedDiagnostics()
        {
            var analyzer    = new IsBusinessObjectSerializableAnalyzer();
            var diagnostics = analyzer.SupportedDiagnostics;

            Assert.AreEqual(1, diagnostics.Length);

            var diagnostic = diagnostics[0];

            Assert.AreEqual(Constants.AnalyzerIdentifiers.IsBusinessObjectSerializable, diagnostic.Id,
                            nameof(DiagnosticDescriptor.Id));
            Assert.AreEqual(IsBusinessObjectSerializableConstants.Title, diagnostic.Title.ToString(),
                            nameof(DiagnosticDescriptor.Title));
            Assert.AreEqual(IsBusinessObjectSerializableConstants.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));
        }