Пример #1
0
        private static void VerifyRule(Microsoft.CodeAnalysis.DiagnosticDescriptor diagnostic, Rule rule)
        {
            diagnostic.Id.Should().Be(rule.Key, "Invalid rule key");
            diagnostic.Id.Should().Be(rule.InternalKey, "Invalid rule internal key");
            RuleGenerator.Cardinality.Should().Be(rule.Cardinality, "Invalid rule cardinality");
            RuleGenerator.Status.Should().Be(rule.Status, "Invalid rule status");

            rule.Name.Should().Be(diagnostic.Title.ToString(), "Invalid rule name");
            rule.Tags.Should().BeNull("No tags information should be derived from the diagnostics");

            VerifyRuleValid(rule);
        }
Пример #2
0
        private static void VerifyRule(Microsoft.CodeAnalysis.DiagnosticDescriptor diagnostic, Rule rule)
        {
            Assert.AreEqual(diagnostic.Id, rule.Key, "Invalid rule key");
            Assert.AreEqual(diagnostic.Id, rule.InternalKey, "Invalid rule internal key");
            Assert.AreEqual(RuleGenerator.Cardinality, rule.Cardinality, "Invalid rule cardinality");
            Assert.AreEqual(RuleGenerator.Status, rule.Status, "Invalid rule status");

            Assert.AreEqual(diagnostic.Title.ToString(), rule.Name, "Invalid rule name");
            Assert.IsNull(rule.Tags, "No tags information should be derived from the diagnostics");

            VerifyRuleValid(rule);
        }