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:
+22
-1
@@ -8,7 +8,7 @@ using ZB.MOM.WW.ScadaBridge.HealthMonitoring.Kpi;
|
||||
namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests.Kpi;
|
||||
|
||||
/// <summary>
|
||||
/// M6 "KPI History & Trends" (K9) coverage for
|
||||
/// "KPI History & Trends" coverage for
|
||||
/// <see cref="SiteHealthKpiSampleSource"/>. The source reads the in-memory
|
||||
/// <see cref="ICentralHealthAggregator"/> and emits per-site
|
||||
/// (<see cref="KpiScopes.Site"/>) <see cref="KpiSample"/> rows for each site that
|
||||
@@ -20,6 +20,7 @@ public class SiteHealthKpiSampleSourceTests
|
||||
private static readonly DateTime CapturedAt =
|
||||
new(2026, 6, 17, 12, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
/// <summary>Verifies that the source identifier is the site health source.</summary>
|
||||
[Fact]
|
||||
public void Source_Is_SiteHealth()
|
||||
{
|
||||
@@ -27,6 +28,8 @@ public class SiteHealthKpiSampleSourceTests
|
||||
Assert.Equal(KpiSources.SiteHealth, source.Source);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that collecting emits every metric for a populated site and nothing for a site with a null report.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task CollectAsync_PopulatedSite_EmitsAllMetrics_NullReportSite_EmitsNothing()
|
||||
{
|
||||
@@ -110,6 +113,8 @@ public class SiteHealthKpiSampleSourceTests
|
||||
// LocalDb replication metrics (register row 33)
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
/// <summary>Verifies that collecting emits neither LocalDb metric when the LocalDb fields are null.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task CollectAsync_NullLocalDbFields_EmitsNeitherLocalDbMetric()
|
||||
{
|
||||
@@ -134,6 +139,8 @@ public class SiteHealthKpiSampleSourceTests
|
||||
Assert.Equal(12, samples.Count);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that collecting emits both LocalDb metrics for a replicated site.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task CollectAsync_ReplicatedSite_EmitsBothLocalDbMetrics()
|
||||
{
|
||||
@@ -154,6 +161,8 @@ public class SiteHealthKpiSampleSourceTests
|
||||
Assert.Equal(14, samples.Count);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that collecting still emits a zero backlog value.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task CollectAsync_ZeroBacklog_IsStillEmitted()
|
||||
{
|
||||
@@ -171,6 +180,8 @@ public class SiteHealthKpiSampleSourceTests
|
||||
Assert.Equal(0, samples.Single(s => s.Metric == "localDbOplogBacklog").Value);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that collecting emits zero rather than omitting the metric when replication is disconnected.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task CollectAsync_DisconnectedReplication_EmitsZeroNotAbsent()
|
||||
{
|
||||
@@ -188,6 +199,8 @@ public class SiteHealthKpiSampleSourceTests
|
||||
Assert.Equal(0, samples.Single(s => s.Metric == "localDbReplicationConnected").Value);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that collecting emits zero pending audit backlog when the audit backlog is null.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task CollectAsync_NullAuditBacklog_EmitsZeroAuditBacklogPending()
|
||||
{
|
||||
@@ -202,6 +215,8 @@ public class SiteHealthKpiSampleSourceTests
|
||||
Assert.Equal(0, samples.Single(s => s.Metric == "auditBacklogPending").Value);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that collecting returns an empty list when no site has a report.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task CollectAsync_NoSitesWithReports_ReturnsEmptyList()
|
||||
{
|
||||
@@ -238,19 +253,25 @@ public class SiteHealthKpiSampleSourceTests
|
||||
/// </summary>
|
||||
private sealed class StubAggregator : ICentralHealthAggregator
|
||||
{
|
||||
/// <summary>Gets the canned per-site health states returned by the fake.</summary>
|
||||
public Dictionary<string, SiteHealthState> States { get; } = new();
|
||||
|
||||
/// <inheritdoc />
|
||||
public IReadOnlyDictionary<string, SiteHealthState> GetAllSiteStates() => States;
|
||||
|
||||
/// <inheritdoc />
|
||||
public SiteHealthState? GetSiteState(string siteId) =>
|
||||
States.TryGetValue(siteId, out var state) ? state : null;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ProcessReport(SiteHealthReport report) =>
|
||||
throw new NotSupportedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public void MarkHeartbeat(string siteId, DateTimeOffset receivedAt) =>
|
||||
throw new NotSupportedException();
|
||||
|
||||
/// <inheritdoc />
|
||||
public void PruneUnknownSites(IReadOnlyCollection<string> knownSiteIds) =>
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user