docs(tests): fix CommentChecker findings across tests/ — 13,392 → 0 (repo-wide scan clean)

Comment/XML-doc changes only:
- add summaries to ~10k test methods, fixtures, fakes and helpers
  (+ <param> on theories, <returns> on async Task methods,
  <inheritdoc/> on interface implementations the checker can resolve)
- strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N,
  #NN, Component-0NN) from comments, keeping the explanatory text;
  reword false positives in comments only
- real docs on fakes implementing BCL/library interfaces
  (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime)
- reword the last 5 src/ false positives (CWE-1236, failures-1,
  year-0001, M365)

Only non-comment edits: four one-line nested classes split across lines
so members can carry docs. Build 0 errors / 0 warnings.
This commit is contained in:
Joseph Doherty
2026-10-07 15:05:49 -04:00
parent 0ffd4bdbea
commit 513fa1aa16
998 changed files with 17896 additions and 2395 deletions
@@ -7,6 +7,7 @@ public class ValidationServiceTests
{
private readonly ValidationService _sut = new();
/// <summary>Verifies that a valid configuration returns success.</summary>
[Fact]
public void Validate_ValidConfig_ReturnsSuccess()
{
@@ -21,6 +22,7 @@ public class ValidationServiceTests
Assert.True(result.IsValid);
}
/// <summary>Verifies that an empty instance name returns an error.</summary>
[Fact]
public void Validate_EmptyInstanceName_ReturnsError()
{
@@ -35,6 +37,7 @@ public class ValidationServiceTests
Assert.Contains(result.Errors, e => e.Category == ValidationCategory.FlatteningFailure);
}
/// <summary>Verifies that a naming collision returns an error.</summary>
[Fact]
public void Validate_NamingCollision_ReturnsError()
{
@@ -53,6 +56,7 @@ public class ValidationServiceTests
Assert.Contains(result.Errors, e => e.Category == ValidationCategory.NamingCollision);
}
/// <summary>Verifies that a forbidden API returns a compilation error.</summary>
[Fact]
public void Validate_ForbiddenApi_ReturnsCompilationError()
{
@@ -74,6 +78,7 @@ public class ValidationServiceTests
Assert.Contains(result.Errors, e => e.Category == ValidationCategory.ScriptCompilation);
}
/// <summary>Verifies that mismatched braces return a compilation error.</summary>
[Fact]
public void Validate_MismatchedBraces_ReturnsCompilationError()
{
@@ -91,6 +96,7 @@ public class ValidationServiceTests
Assert.Contains(result.Errors, e => e.Category == ValidationCategory.ScriptCompilation);
}
/// <summary>Verifies that an alarm referencing a missing attribute returns an error.</summary>
[Fact]
public void Validate_AlarmReferencesMissingAttribute_ReturnsError()
{
@@ -114,6 +120,7 @@ public class ValidationServiceTests
Assert.Contains(result.Errors, e => e.Category == ValidationCategory.AlarmTriggerReference);
}
/// <summary>Verifies that an alarm referencing an existing attribute produces no error.</summary>
[Fact]
public void Validate_AlarmReferencesExistingAttribute_NoError()
{
@@ -137,6 +144,7 @@ public class ValidationServiceTests
Assert.DoesNotContain(result.Errors, e => e.Category == ValidationCategory.AlarmTriggerReference);
}
/// <summary>Verifies that a script trigger referencing a missing attribute returns an error.</summary>
[Fact]
public void Validate_ScriptTriggerReferencesMissingAttribute_ReturnsError()
{
@@ -160,10 +168,11 @@ public class ValidationServiceTests
Assert.Contains(result.Errors, e => e.Category == ValidationCategory.ScriptTriggerReference);
}
/// <summary>Verifies that an unbound data-sourced attribute at design time returns a warning rather than an error.</summary>
[Fact]
public void Validate_UnboundDataSourceAttribute_DesignTime_ReturnsWarningNotError()
{
// M2.8 (#23): at template design time (the default, enforceConnectionBindings:false)
// At template design time (the default, enforceConnectionBindings:false)
// a data-sourced attribute is legitimately unbound — bindings are set later at
// instance/deploy time. So this must stay a non-blocking WARNING and IsValid true.
var config = new FlattenedConfiguration
@@ -187,10 +196,11 @@ public class ValidationServiceTests
Assert.True(result.IsValid);
}
/// <summary>Verifies that an unbound data-sourced attribute at deploy time returns an error and blocks.</summary>
[Fact]
public void Validate_UnboundDataSourceAttribute_DeployTime_ReturnsErrorAndBlocks()
{
// M2.8 (#23): the deploy path opts in (enforceConnectionBindings:true). A data-sourced
// The deploy path opts in (enforceConnectionBindings:true). A data-sourced
// attribute with no binding now gates the deployment as an ERROR (IsValid false).
var config = new FlattenedConfiguration
{
@@ -212,10 +222,11 @@ public class ValidationServiceTests
Assert.False(result.IsValid);
}
/// <summary>Verifies that a static attribute without a binding produces no binding error at deploy time.</summary>
[Fact]
public void Validate_StaticAttributeWithoutBinding_DeployTime_NoBindingError()
{
// M2.8 (#23): only DATA-SOURCED attributes require a binding. A static attribute
// Only DATA-SOURCED attributes require a binding. A static attribute
// (DataSourceReference == null) must remain OK even under deploy-time enforcement.
var config = new FlattenedConfiguration
{
@@ -238,10 +249,11 @@ public class ValidationServiceTests
Assert.True(result.IsValid);
}
/// <summary>Verifies that an attribute bound to an existing site connection produces no binding error at deploy time.</summary>
[Fact]
public void Validate_BoundToExistingSiteConnection_DeployTime_NoBindingError()
{
// M2.8 (#23): a data-sourced attribute bound to a connection that exists at the
// A data-sourced attribute bound to a connection that exists at the
// target site passes the binding gate.
var config = new FlattenedConfiguration
{
@@ -268,10 +280,11 @@ public class ValidationServiceTests
Assert.True(result.IsValid);
}
/// <summary>Verifies that an attribute bound to a non-existent site connection returns an error at deploy time.</summary>
[Fact]
public void Validate_BoundToNonExistentSiteConnection_DeployTime_ReturnsError()
{
// M2.8 (#23): a binding pointing at a connection that does NOT exist on the
// A binding pointing at a connection that does NOT exist on the
// target site is an ERROR that blocks deployment.
var config = new FlattenedConfiguration
{
@@ -298,10 +311,11 @@ public class ValidationServiceTests
Assert.False(result.IsValid);
}
/// <summary>Verifies that the exists-at-site check is inert for a bound attribute when no site is set at deploy time.</summary>
[Fact]
public void Validate_BoundAttributeWithNoSiteSet_DeployTime_ExistsAtSiteCheckIsInert()
{
// M2.8 (#23): when siteConnectionNames is null the "exists at site" half of the
// When siteConnectionNames is null the "exists at site" half of the
// binding check stays inert — a properly-bound data-sourced attribute must NOT
// produce a ConnectionBinding error, even under deploy-time enforcement.
// This pins the contract: passing enforce:true + siteConnectionNames:null is safe
@@ -328,6 +342,7 @@ public class ValidationServiceTests
Assert.True(result.IsValid);
}
/// <summary>Verifies that an empty configuration returns a warning.</summary>
[Fact]
public void Validate_EmptyConfig_ReturnsWarning()
{
@@ -337,12 +352,13 @@ public class ValidationServiceTests
Assert.Contains(result.Warnings, w => w.Category == ValidationCategory.FlatteningFailure);
}
// --- M9-T28a: per-trigger AnalysisKind (Advisory default | Strict escalates) ---
// --- Per-trigger AnalysisKind (Advisory default | Strict escalates) ---
// The only currently-advisory finding in CheckExpressionTrigger is the blank/empty
// expression (which "will never fire"). Advisory keeps it a non-blocking warning;
// Strict promotes it to a deploy-blocking error. The kind rides the existing
// trigger-config JSON ({"expression":"...","analysisKind":"Strict"}) — no migration.
/// <summary>Verifies that a blank expression trigger under the default advisory kind warns but passes.</summary>
[Fact]
public void Validate_ExpressionTrigger_BlankExpression_AdvisoryDefault_WarnsButPasses()
{
@@ -368,6 +384,7 @@ public class ValidationServiceTests
Assert.True(result.IsValid);
}
/// <summary>Verifies that a blank expression trigger under the strict kind fails with an error.</summary>
[Fact]
public void Validate_ExpressionTrigger_BlankExpression_StrictKind_FailsWithError()
{
@@ -392,6 +409,7 @@ public class ValidationServiceTests
Assert.False(result.IsValid);
}
/// <summary>Verifies that a blank script expression trigger under the strict kind fails with an error.</summary>
[Fact]
public void Validate_ScriptExpressionTrigger_BlankExpression_StrictKind_FailsWithError()
{
@@ -416,6 +434,7 @@ public class ValidationServiceTests
Assert.False(result.IsValid);
}
/// <summary>Verifies that a valid expression trigger passes under both kinds.</summary>
[Fact]
public void Validate_ExpressionTrigger_ValidExpression_PassesUnderBothKinds()
{
@@ -463,6 +482,7 @@ public class ValidationServiceTests
Assert.DoesNotContain(strictResult.Warnings, w => w.Category == ValidationCategory.AlarmTriggerReference);
}
/// <summary>Verifies that skipping compilation skips the expression trigger syntax check.</summary>
[Fact]
public void Validate_SkipCompilation_SkipsExpressionTriggerSyntaxCheck()
{
@@ -473,6 +493,7 @@ public class ValidationServiceTests
Assert.Contains(full.Errors, e => e.Message.Contains("failed validation")); // deploy gate unchanged
}
/// <summary>Verifies that skipping compilation still checks the expression attribute references.</summary>
[Fact]
public void Validate_SkipCompilation_StillChecksExpressionAttributeReferences()
{