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:
@@ -48,7 +48,7 @@ public class NotificationKpisPageTests : BunitContext
|
||||
DeliveredLastInterval: 9, OldestPendingAge: TimeSpan.FromMinutes(7)),
|
||||
});
|
||||
|
||||
// KPI-history trend service (K13 / T11). Default substitute returns a
|
||||
// KPI-history trend service Default substitute returns a
|
||||
// 3-point series for any (source, metric, scope, …) tuple so every chart
|
||||
// renders a polyline; individual tests can re-stub it (e.g. to throw).
|
||||
private readonly IKpiHistoryQueryService _kpiHistory = Substitute.For<IKpiHistoryQueryService>();
|
||||
@@ -60,6 +60,7 @@ public class NotificationKpisPageTests : BunitContext
|
||||
new(DateTime.UtcNow.AddHours(-1), 4),
|
||||
};
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>NotificationKpisPageTests</c> class.</summary>
|
||||
public NotificationKpisPageTests()
|
||||
{
|
||||
_comms = new CommunicationService(
|
||||
@@ -71,7 +72,7 @@ public class NotificationKpisPageTests : BunitContext
|
||||
|
||||
Services.AddSingleton(_comms);
|
||||
|
||||
// arch-review WP2.4 — the page reads the process-level memoized KPI cache
|
||||
// The page reads the process-level memoized KPI cache
|
||||
// rather than querying CommunicationService per circuit. The real cache is
|
||||
// registered so the scripted-actor seam above still answers the queries.
|
||||
Services.AddSingleton<IKpiSnapshotCache>(sp => new KpiSnapshotCache(
|
||||
@@ -104,6 +105,8 @@ public class NotificationKpisPageTests : BunitContext
|
||||
Services.AddTestConfigurationMutations();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the page requires the deployment authorization policy.</summary>
|
||||
/// <returns>The result.</returns>
|
||||
[Fact]
|
||||
public void Page_RequiresDeploymentPolicy()
|
||||
{
|
||||
@@ -116,6 +119,8 @@ public class NotificationKpisPageTests : BunitContext
|
||||
Assert.Equal(AuthorizationPolicies.RequireDeployment, attr!.Policy);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the page renders the global KPI tiles and the per-site rows.</summary>
|
||||
/// <returns>The result.</returns>
|
||||
[Fact]
|
||||
public void RendersGlobalTilesAndPerSiteRows()
|
||||
{
|
||||
@@ -130,6 +135,8 @@ public class NotificationKpisPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the page shows an error when the global KPI query fails.</summary>
|
||||
/// <returns>The result.</returns>
|
||||
[Fact]
|
||||
public void ShowsKpiError_WhenGlobalKpiQueryFails()
|
||||
{
|
||||
@@ -141,6 +148,8 @@ public class NotificationKpisPageTests : BunitContext
|
||||
cut.WaitForAssertion(() => Assert.Contains("kpi down", cut.Markup));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the page shows a per-site error, without the global error, when the per-site KPI query fails.</summary>
|
||||
/// <returns>The result.</returns>
|
||||
[Fact]
|
||||
public void ShowsPerSiteError_WhenPerSiteKpiQueryFails()
|
||||
{
|
||||
@@ -159,6 +168,8 @@ public class NotificationKpisPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the page shows the per-site empty state when there are no sites.</summary>
|
||||
/// <returns>The result.</returns>
|
||||
[Fact]
|
||||
public void ShowsPerSiteEmptyState_WhenNoSites()
|
||||
{
|
||||
@@ -170,6 +181,8 @@ public class NotificationKpisPageTests : BunitContext
|
||||
cut.WaitForAssertion(() => Assert.Contains("No per-site activity", cut.Markup));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the page renders trend charts when history series are available.</summary>
|
||||
/// <returns>The result.</returns>
|
||||
[Fact]
|
||||
public void RendersTrendCharts_WhenSeriesAvailable()
|
||||
{
|
||||
@@ -186,6 +199,8 @@ public class NotificationKpisPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a trend query failure for one metric degrades only that metric's chart.</summary>
|
||||
/// <returns>The result.</returns>
|
||||
[Fact]
|
||||
public void PartialTrendFailure_IsolatesToTheFailingMetric()
|
||||
{
|
||||
@@ -224,6 +239,8 @@ public class NotificationKpisPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a failing trend query does not break the page.</summary>
|
||||
/// <returns>The result.</returns>
|
||||
[Fact]
|
||||
public void TrendQueryFailure_DoesNotBreakPage()
|
||||
{
|
||||
@@ -249,6 +266,7 @@ public class NotificationKpisPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
@@ -261,11 +279,13 @@ public class NotificationKpisPageTests : BunitContext
|
||||
/// <summary>
|
||||
/// Stand-in for the notification-outbox actor. Replies to each KPI message
|
||||
/// type with the test's currently-scripted response. Also handles the per-node
|
||||
/// KPI request (T6: M5.2) with an empty-nodes success reply so the page can
|
||||
/// KPI request with an empty-nodes success reply so the page can
|
||||
/// complete initialization without a 30-second Ask timeout.
|
||||
/// </summary>
|
||||
private sealed class ScriptedOutboxActor : ReceiveActor
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <c>ScriptedOutboxActor</c> class.</summary>
|
||||
/// <param name="test">The test.</param>
|
||||
public ScriptedOutboxActor(NotificationKpisPageTests test)
|
||||
{
|
||||
Receive<NotificationKpiRequest>(_ => Sender.Tell(test._kpiReply));
|
||||
|
||||
Reference in New Issue
Block a user