sqlinsight-pro/tests/SQLInsight.Rules.Tests/RuleCatalogTests.cs
Søren Eggert Lundsteen Olsen ab8cfcad97 Configuration page with change log
- new collector instance-config: collation, edition, version, services and
  accounts (sys.dm_server_services, 2008 R2 SP1+), Instant File
  Initialization and Lock Pages in Memory (where the build has the
  columns), tempdb files, default paths; plus a fingerprint of the whole
  setup (sp_configure, trace flags, services, version, tempdb files)
- changes are computed against the previous collection, which the agent
  restores from the repository after a restart; migration 0008 keeps them
  in insight.ConfigurationChanges (as long as resolved findings)
- SQLI-CFG-013 "Konfiguration ændret": information for a day when
  sp_configure, a trace flag or a service account changes (account names
  are sensitive evidence)
- page /instanser/{navn}/konfiguration: instance, CPU and memory, services,
  tempdb, trace flags, non-default sp_configure (default vs. in use vs.
  configured) and the change log; linked from the instance page
- the management report lists configuration changes in the period
- trace flag reading shared by trace-flags and instance-config

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 08:12:26 +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(62, BuiltInRules.Create().Count);
}
}