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:
@@ -54,6 +54,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
private readonly List<RetryNotificationRequest> _retryRequests = new();
|
||||
private readonly List<DiscardNotificationRequest> _discardRequests = new();
|
||||
|
||||
/// <summary>Initializes the test class and registers the services the page needs.</summary>
|
||||
public NotificationReportPageTests()
|
||||
{
|
||||
_comms = new CommunicationService(
|
||||
@@ -84,12 +85,13 @@ public class NotificationReportPageTests : BunitContext
|
||||
Services.AddSingleton<AuthenticationStateProvider>(new TestAuthStateProvider(user));
|
||||
Services.AddAuthorizationCore();
|
||||
Services.AddTestConfigurationMutations();
|
||||
// CentralUI-028: the page now injects SiteScopeService — the test user
|
||||
// The page now injects SiteScopeService — the test user
|
||||
// has no SiteId claims, so this resolves to system-wide and the
|
||||
// pre-existing test expectations hold.
|
||||
Services.AddScoped<ZB.MOM.WW.ScadaBridge.CentralUI.Auth.SiteScopeService>();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the page requires the Deployment policy.</summary>
|
||||
[Fact]
|
||||
public void Page_RequiresDeploymentPolicy()
|
||||
{
|
||||
@@ -102,6 +104,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
Assert.Equal(AuthorizationPolicies.RequireDeployment, attr!.Policy);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the page renders the notification rows.</summary>
|
||||
[Fact]
|
||||
public void Renders_NotificationRows()
|
||||
{
|
||||
@@ -115,6 +118,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a stuck row is badged.</summary>
|
||||
[Fact]
|
||||
public void StuckRow_IsBadged()
|
||||
{
|
||||
@@ -131,6 +135,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that clicking Retry on a parked row calls the retry notification command.</summary>
|
||||
[Fact]
|
||||
public void ClickRetry_OnParkedRow_CallsRetryNotification()
|
||||
{
|
||||
@@ -152,6 +157,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that clicking Discard on a parked row calls the discard notification command.</summary>
|
||||
[Fact]
|
||||
public void ClickDiscard_OnParkedRow_CallsDiscardNotification()
|
||||
{
|
||||
@@ -173,6 +179,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a query failure shows an error message.</summary>
|
||||
[Fact]
|
||||
public void QueryFailure_ShowsErrorMessage()
|
||||
{
|
||||
@@ -187,10 +194,11 @@ public class NotificationReportPageTests : BunitContext
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
// Bundle D drill-in (#23 M7-T10) — every notification row carries a
|
||||
// Audit drill-in — every notification row carries a
|
||||
// "View audit history" link to /audit/log?correlationId={NotificationId}.
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Verifies that the View audit history link on a notification row has the correct href.</summary>
|
||||
[Fact]
|
||||
public void NotificationRow_ViewAuditHistory_Link_HasCorrectHref()
|
||||
{
|
||||
@@ -220,6 +228,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that clicking the audit history link navigates to the Audit Log with the correlation id.</summary>
|
||||
[Fact]
|
||||
public void Click_NavigatesTo_AuditLog_WithCorrelationId()
|
||||
{
|
||||
@@ -249,6 +258,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
// with that id comes back.
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Verifies that a dashed GUID in the correlation id query is normalised to the stored N form.</summary>
|
||||
[Fact]
|
||||
public void NotificationReport_CorrelationIdQuery_DashedGuid_IsNormalisedToTheStoredNForm()
|
||||
{
|
||||
@@ -268,6 +278,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the correlation id query seeds the notification filter and automatically opens the detail view.</summary>
|
||||
[Fact]
|
||||
public void NotificationReport_CorrelationIdQuery_SeedsTheNotificationFilterAndAutoOpensDetail()
|
||||
{
|
||||
@@ -303,6 +314,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that clearing the filters drops the notification filter.</summary>
|
||||
[Fact]
|
||||
public void ClearFilters_DropsTheNotificationFilter()
|
||||
{
|
||||
@@ -326,6 +338,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that clearing the notification filter pill drops the filter and re-queries.</summary>
|
||||
[Fact]
|
||||
public void NotificationFilterPill_Clear_DropsTheFilterAndRequeries()
|
||||
{
|
||||
@@ -346,6 +359,7 @@ public class NotificationReportPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
@@ -361,6 +375,8 @@ public class NotificationReportPageTests : BunitContext
|
||||
/// </summary>
|
||||
private sealed class ScriptedOutboxActor : ReceiveActor
|
||||
{
|
||||
/// <summary>Initializes the actor with the test that owns it.</summary>
|
||||
/// <param name="test">The test.</param>
|
||||
public ScriptedOutboxActor(NotificationReportPageTests test)
|
||||
{
|
||||
Receive<NotificationOutboxQueryRequest>(req =>
|
||||
@@ -397,19 +413,28 @@ public class NotificationReportPageTests : BunitContext
|
||||
/// <summary>A dialog service that auto-confirms, so action paths run end-to-end.</summary>
|
||||
private sealed class AlwaysConfirmDialogService : IDialogService
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ConfirmAsync(string title, string message, bool danger = false, string? confirmLabel = null)
|
||||
=> Task.FromResult(true);
|
||||
|
||||
// Register row 75 added a DialogSeverity overload. This stub auto-confirms
|
||||
// regardless of severity — it exists to let action paths run end to end, not to
|
||||
// assert anything about styling.
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ConfirmAsync(string title, string message, DialogSeverity severity, string? confirmLabel = null)
|
||||
=> Task.FromResult(true);
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<string?> PromptAsync(
|
||||
string title, string label, string initialValue = "", string? placeholder = null)
|
||||
=> Task.FromResult<string?>(null);
|
||||
|
||||
/// <summary>Returns the default result without showing a dialog.</summary>
|
||||
/// <typeparam name="TResult">The dialog result type.</typeparam>
|
||||
/// <param name="title">The dialog title.</param>
|
||||
/// <param name="body">The dialog body fragment.</param>
|
||||
/// <param name="size">The optional dialog size.</param>
|
||||
/// <returns>A task that resolves to the default result.</returns>
|
||||
public Task<TResult?> ShowAsync<TResult>(
|
||||
string title,
|
||||
Microsoft.AspNetCore.Components.RenderFragment<DialogContext<TResult>> body,
|
||||
|
||||
Reference in New Issue
Block a user