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:
@@ -21,6 +21,7 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests;
|
||||
/// </summary>
|
||||
public class DataConnectionsPageTests : BunitContext
|
||||
{
|
||||
/// <summary>Verifies the case: storage Save Fixture, completes Invocation Immediately.</summary>
|
||||
[Fact]
|
||||
public void StorageSaveFixture_CompletesInvocationImmediately()
|
||||
{
|
||||
@@ -29,17 +30,18 @@ public class DataConnectionsPageTests : BunitContext
|
||||
}
|
||||
|
||||
private readonly ISiteRepository _siteRepo = Substitute.For<ISiteRepository>();
|
||||
// M9-T25: the design page now injects IConnectionHealthQueryService to render
|
||||
// The design page now injects IConnectionHealthQueryService to render
|
||||
// per-connection live health badges. A substitute defaulting to an empty map
|
||||
// keeps every existing test green (no badge / unknown state when no report).
|
||||
private readonly IConnectionHealthQueryService _healthQuery =
|
||||
Substitute.For<IConnectionHealthQueryService>();
|
||||
// M9-T24b: the page now opens a Move-to-Site dialog that dispatches the move
|
||||
// The page now opens a Move-to-Site dialog that dispatches the move
|
||||
// through IDataConnectionMoveService (the guard-running ManagementActor path).
|
||||
// Substituted so the page renders without a real ManagementActor in scope.
|
||||
private readonly IDataConnectionMoveService _moveService =
|
||||
Substitute.For<IDataConnectionMoveService>();
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="DataConnectionsPageTests"/> class.</summary>
|
||||
public DataConnectionsPageTests()
|
||||
{
|
||||
Services.AddSingleton(_siteRepo);
|
||||
@@ -48,7 +50,7 @@ public class DataConnectionsPageTests : BunitContext
|
||||
// Satisfy the page's [Inject] IDialogService — the host that actually
|
||||
// renders the dialog lives in MainLayout, not in bUnit's render scope.
|
||||
Services.AddScoped<IDialogService, DialogService>();
|
||||
// arch-review P6-4: the page now filters its site/connection tree through
|
||||
// The page now filters its site/connection tree through
|
||||
// SiteScopeService, so it must be resolvable in every render test.
|
||||
Services.AddScoped<ZB.MOM.WW.ScadaBridge.CentralUI.Auth.SiteScopeService>();
|
||||
AddTestAuth();
|
||||
@@ -90,6 +92,7 @@ public class DataConnectionsPageTests : BunitContext
|
||||
.FirstOrDefault(row => row.QuerySelector(".tv-label")?.TextContent == label)
|
||||
?.QuerySelector(".tv-toggle");
|
||||
|
||||
/// <summary>Verifies the case: renders, empty State, when No Sites.</summary>
|
||||
[Fact]
|
||||
public void Renders_EmptyState_WhenNoSites()
|
||||
{
|
||||
@@ -100,6 +103,7 @@ public class DataConnectionsPageTests : BunitContext
|
||||
Assert.Contains("No sites configured", cut.Markup);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: renders, empty Site, as Top Level Node.</summary>
|
||||
[Fact]
|
||||
public void Renders_EmptySite_AsTopLevelNode()
|
||||
{
|
||||
@@ -112,6 +116,7 @@ public class DataConnectionsPageTests : BunitContext
|
||||
Assert.Contains("Plant-A", cut.Markup);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: renders, site Connection, nesting.</summary>
|
||||
[Fact]
|
||||
public void Renders_SiteConnection_Nesting()
|
||||
{
|
||||
@@ -129,6 +134,7 @@ public class DataConnectionsPageTests : BunitContext
|
||||
Assert.Contains("OpcUa", cut.Markup);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: search, dims Non Matches, preserves Shape.</summary>
|
||||
[Fact]
|
||||
public void Search_DimsNonMatches_PreservesShape()
|
||||
{
|
||||
@@ -156,6 +162,7 @@ public class DataConnectionsPageTests : BunitContext
|
||||
Assert.Contains(dimmedNodes, n => n.TextContent.Contains("Plant-B"));
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: add Connection Button, disabled Until Site Selected.</summary>
|
||||
[Fact]
|
||||
public void AddConnectionButton_DisabledUntilSiteSelected()
|
||||
{
|
||||
@@ -178,6 +185,7 @@ public class DataConnectionsPageTests : BunitContext
|
||||
Assert.False(addBtnAfter.HasAttribute("disabled"));
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: data Connections Routes, are Declared On List Page.</summary>
|
||||
[Fact]
|
||||
public void DataConnectionsRoutes_AreDeclaredOnListPage()
|
||||
{
|
||||
@@ -194,10 +202,11 @@ public class DataConnectionsPageTests : BunitContext
|
||||
Assert.Contains("/design/data-connections", routes);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: connection Node, renders Live Health Badge, matching Status.</summary>
|
||||
[Fact]
|
||||
public void ConnectionNode_RendersLiveHealthBadge_MatchingStatus()
|
||||
{
|
||||
// M9-T25: a connection whose live health is Connected gets the success
|
||||
// A connection whose live health is Connected gets the success
|
||||
// health badge next to its node; a Disconnected one gets the danger badge.
|
||||
SeedRepos(
|
||||
sites: new[] { new Site("Plant-A", "plant-a") { Id = 1 } },
|
||||
@@ -228,10 +237,11 @@ public class DataConnectionsPageTests : BunitContext
|
||||
Assert.Contains("Disconnected", disconnectedBadge.TextContent);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: connection Node, has, move To Site Action.</summary>
|
||||
[Fact]
|
||||
public void ConnectionNode_Has_MoveToSiteAction()
|
||||
{
|
||||
// M9-T24b: each connection node exposes a "Move to Site…" action alongside
|
||||
// Each connection node exposes a "Move to Site…" action alongside
|
||||
// Edit/Delete.
|
||||
SeedRepos(
|
||||
sites: new[]
|
||||
@@ -248,10 +258,11 @@ public class DataConnectionsPageTests : BunitContext
|
||||
b => b.TextContent.Contains("Move to Site"));
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: move To Site, opens Dialog, excluding Current Site.</summary>
|
||||
[Fact]
|
||||
public void MoveToSite_OpensDialog_ExcludingCurrentSite()
|
||||
{
|
||||
// M9-T24b: clicking "Move to Site…" opens the move dialog whose target-site
|
||||
// Clicking "Move to Site…" opens the move dialog whose target-site
|
||||
// picker omits the connection's current site (Plant-A) and lists the others.
|
||||
SeedRepos(
|
||||
sites: new[]
|
||||
@@ -284,10 +295,11 @@ public class DataConnectionsPageTests : BunitContext
|
||||
Assert.DoesNotContain(optionLabels, l => l.Contains("Plant-A"));
|
||||
}
|
||||
|
||||
// ── arch-review P6-4: site scoping. This page reads ISiteRepository directly,
|
||||
// ── site scoping. This page reads ISiteRepository directly,
|
||||
// bypassing ManagementActor's scope gate, and Designer is NOT exempt from
|
||||
// site scope — so a scoped Designer used to see every site's connections. ──
|
||||
|
||||
/// <summary>Verifies the case: site Scoping, scoped Designer, sees Only Permitted Sites And Connections.</summary>
|
||||
[Fact]
|
||||
public void SiteScoping_ScopedDesigner_SeesOnlyPermittedSitesAndConnections()
|
||||
{
|
||||
@@ -321,6 +333,7 @@ public class DataConnectionsPageTests : BunitContext
|
||||
Assert.DoesNotContain("PLC-B", cut.Markup);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: site Scoping, system Wide User, sees Every Connection.</summary>
|
||||
[Fact]
|
||||
public void SiteScoping_SystemWideUser_SeesEveryConnection()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user