sqlinsight-pro/tests/SQLInsight.Rules.Tests/RuleCatalogTests.cs
Søren Eggert Lundsteen Olsen d27323a1a4 Availability groups: cluster node or witness down (D)
The availability group collector also reads sys.dm_hadr_cluster_members
(empty or unavailable without a WSFC), and SQLI-AG-003 (High) reports a
node or witness that is not up, with how many members are still up.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 10:56:43 +02:00

23 lines
676 B
C#

using SQLInsight.Rules.Engine;
namespace SQLInsight.Rules.Tests;
public class RuleCatalogTests
{
[Fact]
public void Every_rule_has_a_unique_well_formed_id()
{
var rules = BuiltInRules.Create();
Assert.Equal(rules.Count, rules.Select(r => r.Id).Distinct(StringComparer.OrdinalIgnoreCase).Count());
Assert.All(rules, r => Assert.Matches("^SQLI-[A-Z]+-[0-9]{3}$", r.Id));
Assert.All(rules, r => Assert.False(string.IsNullOrWhiteSpace(r.Title)));
}
/// <summary>Keeps the rule count in the README honest.</summary>
[Fact]
public void Rule_count()
{
Assert.Equal(82, BuiltInRules.Create().Count);
}
}