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 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Layout;
|
||||
|
||||
/// <summary>
|
||||
/// bUnit rendering tests for the rail <see cref="NavMenu"/>. After the
|
||||
/// ZB.MOM.WW.Theme adoption (Task 2.4) the nav is composed of the kit's
|
||||
/// ZB.MOM.WW.Theme adoption the nav is composed of the kit's
|
||||
/// <c>NavRailSection</c> (a native <c><details></c> disclosure, expanded
|
||||
/// by default — no JS interop, works in static SSR) and <c>NavRailItem</c>
|
||||
/// links. These tests verify the structure (sections render as
|
||||
@@ -74,6 +74,7 @@ public class NavMenuTests : BunitContext
|
||||
return host.FindComponent<NavMenu>();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a Viewer sees the Flow Debugger link and no empty Notifications section.</summary>
|
||||
[Fact]
|
||||
public void Viewer_HasFlowDebuggerAndNoEmptyNotificationsSection()
|
||||
{
|
||||
@@ -85,6 +86,7 @@ public class NavMenuTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that nav sections render as kit details disclosures that are expanded by default.</summary>
|
||||
[Fact]
|
||||
public void Sections_RenderAsKitDetailsDisclosures_ExpandedByDefault()
|
||||
{
|
||||
@@ -108,6 +110,7 @@ public class NavMenuTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the Deployment section renders all of its items for a Deployer.</summary>
|
||||
[Fact]
|
||||
public void DeploymentSection_RendersAllItems_ForDeployer()
|
||||
{
|
||||
@@ -121,6 +124,7 @@ public class NavMenuTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the Notifications section shows all of its items for a user with multiple roles.</summary>
|
||||
[Fact]
|
||||
public void NotificationsSection_ShowsAllItems_ForMultiRoleUser()
|
||||
{
|
||||
@@ -136,6 +140,7 @@ public class NavMenuTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an Administrator-only user sees only the SMTP item in the Notifications section.</summary>
|
||||
[Fact]
|
||||
public void NotificationsSection_AdminOnlyUser_SeesOnlySmtp()
|
||||
{
|
||||
@@ -150,6 +155,7 @@ public class NavMenuTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the old routes are no longer linked from the nav.</summary>
|
||||
[Fact]
|
||||
public void OldRoutes_AreNoLongerLinked()
|
||||
{
|
||||
@@ -162,6 +168,7 @@ public class NavMenuTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the Secrets link in the Admin section is visible to an Administrator.</summary>
|
||||
[Fact]
|
||||
public void AdminSection_SecretsLink_VisibleForAdministrator()
|
||||
{
|
||||
@@ -174,6 +181,7 @@ public class NavMenuTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the Secrets link in the Admin section is absent for a non-Administrator.</summary>
|
||||
[Fact]
|
||||
public void AdminSection_SecretsLink_AbsentForNonAdministrator()
|
||||
{
|
||||
@@ -193,6 +201,7 @@ public class NavMenuTests : BunitContext
|
||||
// is the witness — its heading lives inside the policy block, so a denied
|
||||
// user must not even see the eyebrow.
|
||||
|
||||
/// <summary>Verifies that a policy-gated section is visible to an authorized principal.</summary>
|
||||
[Fact]
|
||||
public void PolicyGatedSection_IsVisible_ForAuthorizedPrincipal()
|
||||
{
|
||||
@@ -207,6 +216,7 @@ public class NavMenuTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a policy-gated section is absent for an unauthorized principal.</summary>
|
||||
[Fact]
|
||||
public void PolicyGatedSection_IsAbsent_ForUnauthorizedPrincipal()
|
||||
{
|
||||
@@ -221,6 +231,7 @@ public class NavMenuTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that all policy-gated sections are absent for an anonymous principal.</summary>
|
||||
[Fact]
|
||||
public void PolicyGatedSections_AllAbsent_ForAnonymousPrincipal()
|
||||
{
|
||||
|
||||
@@ -86,10 +86,14 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
{
|
||||
private readonly ClaimsPrincipal _user;
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>CountingAuthStateProvider</c> class.</summary>
|
||||
/// <param name="user">The user whose claims the provider exposes.</param>
|
||||
public CountingAuthStateProvider(ClaimsPrincipal user) => _user = user;
|
||||
|
||||
/// <summary>Gets the calls recorded by this fake.</summary>
|
||||
public int Calls { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Task<AuthenticationState> GetAuthenticationStateAsync()
|
||||
{
|
||||
Calls++;
|
||||
@@ -122,6 +126,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
return host.FindComponent<PendingUpdatesIndicator>();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a user with only the Viewer role sees no pending-updates indicator.</summary>
|
||||
[Fact]
|
||||
public void Viewer_RendersNothing()
|
||||
{
|
||||
@@ -130,6 +135,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
Assert.True(string.IsNullOrWhiteSpace(cut.Markup));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a Deployer with nothing pending sees the up-to-date state.</summary>
|
||||
[Fact]
|
||||
public void Deployer_WithNothingPending_ShowsUpToDate()
|
||||
{
|
||||
@@ -145,6 +151,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the snapshot is captioned with the instant at which it was computed.</summary>
|
||||
[Fact]
|
||||
public void Snapshot_IsCaptionedWithItsComputedInstant()
|
||||
{
|
||||
@@ -160,6 +167,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a user who is both Deployer and Administrator sees the total pending count and both links.</summary>
|
||||
[Fact]
|
||||
public void DeployerAndAdministrator_WithPendingWork_ShowsTotalAndBothLinks()
|
||||
{
|
||||
@@ -188,6 +196,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a Deployer without the Administrator role sees the site count as plain text.</summary>
|
||||
[Fact]
|
||||
public void DeployerWithoutAdministrator_ShowsSiteCountAsPlainText()
|
||||
{
|
||||
@@ -210,6 +219,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an Administrator without the Deployer role sees the instance count as plain text.</summary>
|
||||
[Fact]
|
||||
public void AdministratorWithoutDeployer_ShowsInstanceCountAsPlainText()
|
||||
{
|
||||
@@ -227,6 +237,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a cache fault shows an unavailable state with the fault message as a tooltip.</summary>
|
||||
[Fact]
|
||||
public void CacheFault_ShowsUnavailableWithTheMessageAsTooltip()
|
||||
{
|
||||
@@ -241,6 +252,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a site-scoped Deployer is shown counts for the permitted sites only.</summary>
|
||||
[Fact]
|
||||
public void SiteScopedDeployer_CountsOnlyPermittedSites()
|
||||
{
|
||||
@@ -264,6 +276,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Verifies that disposing the component after it has rendered does not throw.</summary>
|
||||
[Fact]
|
||||
public void Dispose_AfterRender_DoesNotThrow()
|
||||
{
|
||||
@@ -278,6 +291,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
instance.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a cascaded authentication state is used instead of asking the authentication state provider.</summary>
|
||||
[Fact]
|
||||
public void CascadedAuthenticationState_IsUsedInsteadOfAskingTheProvider()
|
||||
{
|
||||
@@ -296,6 +310,8 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
Assert.Equal(0, anonymous.Calls);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that polling does not resolve any further authentication state.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Polling_ResolvesNoFurtherAuthenticationState()
|
||||
{
|
||||
@@ -331,6 +347,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
Assert.Contains("2 instances", cut.Markup);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an authentication state change hides the indicator when the role is revoked.</summary>
|
||||
[Fact]
|
||||
public void AuthenticationStateChange_HidesTheBlockWhenTheRoleIsRevoked()
|
||||
{
|
||||
@@ -358,11 +375,16 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
{
|
||||
private ClaimsPrincipal _user;
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>MutableAuthStateProvider</c> class.</summary>
|
||||
/// <param name="user">The user whose claims the provider exposes.</param>
|
||||
public MutableAuthStateProvider(ClaimsPrincipal user) => _user = user;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Task<AuthenticationState> GetAuthenticationStateAsync()
|
||||
=> Task.FromResult(new AuthenticationState(_user));
|
||||
|
||||
/// <summary>Replaces the user returned by the provider and notifies listeners of the authentication state change.</summary>
|
||||
/// <param name="user">The user whose claims the provider exposes.</param>
|
||||
public void SetUser(ClaimsPrincipal user)
|
||||
{
|
||||
_user = user;
|
||||
@@ -370,6 +392,7 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that polling starts once an asynchronous authentication resolve completes.</summary>
|
||||
[Fact]
|
||||
public void Polling_StartsAfterAnAsynchronousAuthResolveCompletes()
|
||||
{
|
||||
@@ -408,8 +431,11 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
{
|
||||
private readonly Task<AuthenticationState> _state;
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>DeferredAuthStateProvider</c> class.</summary>
|
||||
/// <param name="state">The authentication state the provider returns.</param>
|
||||
public DeferredAuthStateProvider(Task<AuthenticationState> state) => _state = state;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Task<AuthenticationState> GetAuthenticationStateAsync() => _state;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user