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:
@@ -12,7 +12,7 @@ using SchemaLibraryPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Desig
|
||||
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Design;
|
||||
|
||||
/// <summary>
|
||||
/// bUnit tests for the Schema Library page (M9-T32c). The page lists the reusable named
|
||||
/// bUnit tests for the Schema Library page. The page lists the reusable named
|
||||
/// JSON-Schema library entries, authors create/edit via the shared <c>SchemaBuilder</c>
|
||||
/// component, and deletes with a confirm — every mutation dispatched through
|
||||
/// <see cref="ISchemaLibraryService"/> (the guard-running ManagementActor path), never a
|
||||
@@ -23,6 +23,7 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
{
|
||||
private readonly ISchemaLibraryService _service = Substitute.For<ISchemaLibraryService>();
|
||||
|
||||
/// <summary>Initializes the test context with a substituted schema library service and an auto-confirming dialog service.</summary>
|
||||
public SchemaLibraryPageTests()
|
||||
{
|
||||
Services.AddSingleton(_service);
|
||||
@@ -51,6 +52,7 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
_service.ListAsync(Arg.Any<CancellationToken>())
|
||||
.Returns(Task.FromResult<IReadOnlyList<SharedSchema>>(schemas.ToList()));
|
||||
|
||||
/// <summary>Verifies that the page renders the empty state when there are no schemas.</summary>
|
||||
[Fact]
|
||||
public void Renders_EmptyState_WhenNoSchemas()
|
||||
{
|
||||
@@ -60,6 +62,7 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
Assert.Contains("No library schemas defined", cut.Markup));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that existing schemas are listed together with their library reference.</summary>
|
||||
[Fact]
|
||||
public void Lists_ExistingSchemas_WithLibReference()
|
||||
{
|
||||
@@ -78,6 +81,7 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that choosing New Schema opens the editor with the schema builder.</summary>
|
||||
[Fact]
|
||||
public void NewSchema_OpensEditor_WithSchemaBuilder()
|
||||
{
|
||||
@@ -92,6 +96,7 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
Assert.NotNull(cut.FindComponent<SchemaBuilder>());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that creating a schema dispatches a create command carrying the name and schema.</summary>
|
||||
[Fact]
|
||||
public void Create_DispatchesCreateCommand_WithNameAndSchema()
|
||||
{
|
||||
@@ -112,6 +117,7 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
"Address", Arg.Any<string?>(), Arg.Any<string>(), Arg.Any<CancellationToken>()));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a guard error from a create is shown inline and the editor stays open.</summary>
|
||||
[Fact]
|
||||
public void Create_GuardError_IsShownInline_AndEditorStaysOpen()
|
||||
{
|
||||
@@ -133,6 +139,7 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that saving with an empty name dispatches no command.</summary>
|
||||
[Fact]
|
||||
public void EmptyName_DoesNotDispatch()
|
||||
{
|
||||
@@ -148,6 +155,7 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
Arg.Any<string>(), Arg.Any<string?>(), Arg.Any<string>(), Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that deleting a schema confirms first, dispatches a delete command and reloads the list.</summary>
|
||||
[Fact]
|
||||
public void Delete_ConfirmsThenDispatchesDeleteCommand_AndReloads()
|
||||
{
|
||||
@@ -168,6 +176,7 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that editing a schema opens the editor and dispatches an update command.</summary>
|
||||
[Fact]
|
||||
public void Edit_OpensEditor_AndDispatchesUpdateCommand()
|
||||
{
|
||||
@@ -188,10 +197,11 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
9, "Address", Arg.Any<string?>(), Arg.Any<string>(), Arg.Any<CancellationToken>()));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that row actions are disabled while the editor is open so the row under edit cannot be deleted.</summary>
|
||||
[Fact]
|
||||
public void Editing_DisablesRowActions_SoTheRowUnderEditCannotBeDeleted()
|
||||
{
|
||||
// #260: while the edit form is open the list still shows the row, but its
|
||||
// While the edit form is open the list still shows the row, but its
|
||||
// Edit/Delete actions must be disabled so the row under edit (or a sibling)
|
||||
// can't be deleted out from under the form.
|
||||
SeedSchemas(new SharedSchema { Id = 9, Name = "Address", Scope = "us", SchemaJson = "{\"type\":\"object\"}" });
|
||||
@@ -211,19 +221,28 @@ public class SchemaLibraryPageTests : BunitContext
|
||||
/// <summary>A dialog service that auto-confirms, so the delete path runs 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 type of result the dialog would produce.</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 whose result is the default value of <typeparamref name="TResult"/>.</returns>
|
||||
public Task<TResult?> ShowAsync<TResult>(
|
||||
string title,
|
||||
Microsoft.AspNetCore.Components.RenderFragment<DialogContext<TResult>> body,
|
||||
|
||||
Reference in New Issue
Block a user