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>
23 lines
676 B
C#
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);
|
|
}
|
|
}
|