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:
@@ -6,6 +6,7 @@ public class SiteHealthCollectorTests
|
||||
{
|
||||
private readonly SiteHealthCollector _collector = new();
|
||||
|
||||
/// <summary>Verifies that a report has zero counters when no errors have been recorded.</summary>
|
||||
[Fact]
|
||||
public void CollectReport_ReturnsZeroCounters_WhenNoErrorsRecorded()
|
||||
{
|
||||
@@ -17,6 +18,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(0, report.DeadLetterCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that script errors accumulate between reports.</summary>
|
||||
[Fact]
|
||||
public void IncrementScriptError_AccumulatesBetweenReports()
|
||||
{
|
||||
@@ -28,6 +30,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(3, report.ScriptErrorCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that alarm errors accumulate between reports.</summary>
|
||||
[Fact]
|
||||
public void IncrementAlarmError_AccumulatesBetweenReports()
|
||||
{
|
||||
@@ -38,6 +41,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(2, report.AlarmEvaluationErrorCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a report carries the script scheduler statistics.</summary>
|
||||
[Fact]
|
||||
public void CollectReport_CarriesScriptSchedulerStats()
|
||||
{
|
||||
@@ -48,6 +52,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(42.5, report.ScriptOldestBusyAgeSeconds);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that script scheduler statistics default to zero and null.</summary>
|
||||
[Fact]
|
||||
public void CollectReport_ScriptSchedulerStats_DefaultToZeroAndNull()
|
||||
{
|
||||
@@ -57,6 +62,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Null(report.ScriptOldestBusyAgeSeconds);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that dead letters accumulate between reports.</summary>
|
||||
[Fact]
|
||||
public void IncrementDeadLetter_AccumulatesBetweenReports()
|
||||
{
|
||||
@@ -66,6 +72,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(1, report.DeadLetterCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that collecting a report resets the counters.</summary>
|
||||
[Fact]
|
||||
public void CollectReport_ResetsCounters_AfterCollection()
|
||||
{
|
||||
@@ -84,6 +91,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(0, second.DeadLetterCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a connection health update is reflected in the report.</summary>
|
||||
[Fact]
|
||||
public void UpdateConnectionHealth_ReflectedInReport()
|
||||
{
|
||||
@@ -97,6 +105,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(ConnectionHealth.Disconnected, report.DataConnectionStatuses["opc-2"]);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that connection health is not reset after a report is collected.</summary>
|
||||
[Fact]
|
||||
public void ConnectionHealth_NotResetAfterCollect()
|
||||
{
|
||||
@@ -109,6 +118,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(ConnectionHealth.Connected, second.DataConnectionStatuses["opc-1"]);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that removing a connection removes it from the report.</summary>
|
||||
[Fact]
|
||||
public void RemoveConnection_RemovesFromReport()
|
||||
{
|
||||
@@ -121,6 +131,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Empty(report.TagResolutionCounts);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a tag resolution update is reflected in the report.</summary>
|
||||
[Fact]
|
||||
public void UpdateTagResolution_ReflectedInReport()
|
||||
{
|
||||
@@ -133,6 +144,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(45, report.TagResolutionCounts["opc-1"].SuccessfullyResolved);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that store-and-forward buffer depths default to empty when the setter was never called.</summary>
|
||||
[Fact]
|
||||
public void StoreAndForwardBufferDepths_DefaultsToEmpty_WhenSetterNotCalled()
|
||||
{
|
||||
@@ -140,6 +152,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Empty(report.StoreAndForwardBufferDepths);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a report includes a UTC timestamp.</summary>
|
||||
[Fact]
|
||||
public void CollectReport_IncludesUtcTimestamp()
|
||||
{
|
||||
@@ -151,7 +164,7 @@ public class SiteHealthCollectorTests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// HealthMonitoring-016 regression: <see cref="SiteHealthCollector.CollectReport"/>
|
||||
/// Regression: <see cref="SiteHealthCollector.CollectReport"/>
|
||||
/// must stamp <c>ReportTimestamp</c> from an injected <see cref="TimeProvider"/>
|
||||
/// (consistent with the rest of the module), not directly from
|
||||
/// <c>DateTimeOffset.UtcNow</c>, so the report timestamp is deterministically
|
||||
@@ -168,6 +181,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(fixedInstant, report.ReportTimestamp);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a report sequence number is zero because the caller assigns it.</summary>
|
||||
[Fact]
|
||||
public void CollectReport_SequenceNumberIsZero_CallerAssignsIt()
|
||||
{
|
||||
@@ -175,10 +189,11 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(0, report.SequenceNumber);
|
||||
}
|
||||
|
||||
// HealthMonitoring-009 regression: the remaining collector setters had no
|
||||
// Regression coverage: the remaining collector setters had no
|
||||
// "reflected in report" coverage. The following tests verify each setter's
|
||||
// value reaches CollectReport output.
|
||||
|
||||
/// <summary>Verifies that the cluster nodes are reflected in the report.</summary>
|
||||
[Fact]
|
||||
public void SetClusterNodes_ReflectedInReport()
|
||||
{
|
||||
@@ -196,6 +211,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal("node-a", report.ClusterNodes[0].Hostname);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the instance counts are reflected in the report.</summary>
|
||||
[Fact]
|
||||
public void SetInstanceCounts_ReflectedInReport()
|
||||
{
|
||||
@@ -208,6 +224,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(3, report.DisabledInstanceCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the parked message count is reflected in the report.</summary>
|
||||
[Fact]
|
||||
public void SetParkedMessageCount_ReflectedInReport()
|
||||
{
|
||||
@@ -218,6 +235,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(42, report.ParkedMessageCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the node hostname is reflected in the report.</summary>
|
||||
[Fact]
|
||||
public void SetNodeHostname_ReflectedInReport()
|
||||
{
|
||||
@@ -228,6 +246,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal("site-host-1", report.NodeHostname);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the active-node setting is reflected in the node role.</summary>
|
||||
[Fact]
|
||||
public void SetActiveNode_ReflectedInNodeRole()
|
||||
{
|
||||
@@ -240,6 +259,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.False(_collector.IsActiveNode);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a tag quality update is reflected in the report.</summary>
|
||||
[Fact]
|
||||
public void UpdateTagQuality_ReflectedInReport()
|
||||
{
|
||||
@@ -254,6 +274,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(5, quality.Uncertain);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a connection endpoint update is reflected in the report.</summary>
|
||||
[Fact]
|
||||
public void UpdateConnectionEndpoint_ReflectedInReport()
|
||||
{
|
||||
@@ -265,6 +286,7 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal("opc.tcp://plc-1:4840", report.DataConnectionEndpoints!["opc-1"]);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the store-and-forward depths are reflected in the report.</summary>
|
||||
[Fact]
|
||||
public void SetStoreAndForwardDepths_ReflectedInReport()
|
||||
{
|
||||
@@ -280,6 +302,8 @@ public class SiteHealthCollectorTests
|
||||
Assert.Equal(2, report.StoreAndForwardBufferDepths["Notification"]);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that concurrent increments are counted without loss.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task ThreadSafety_ConcurrentIncrements()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user