docs+ui: backfill XML doc comments and finish dashboard layout pass

Adds missing <summary>/<param> XML docs across 99 server, worker, and test
files so CommentChecker reports zero issues (TreatWarningsAsErrors needs the
analyzer clean). Bundles in WIP dashboard work: NavSection extraction,
MainLayout/site.css/js styling alignment, and DashboardOptions/Auth tweaks.
This commit is contained in:
Joseph Doherty
2026-05-27 14:20:10 -04:00
parent 382861c602
commit 615b487a77
110 changed files with 1473 additions and 192 deletions
@@ -9,6 +9,7 @@ namespace ZB.MOM.WW.MxGateway.Tests.Gateway.Dashboard;
public sealed class DashboardSessionAdminServiceTests
{
/// <summary>Verifies that a viewer cannot close a session.</summary>
[Fact]
public async Task CloseSessionAsync_ViewerCannotManage()
{
@@ -24,6 +25,7 @@ public sealed class DashboardSessionAdminServiceTests
Assert.Equal(0, sessionManager.CloseCount);
}
/// <summary>Verifies that an admin can close a session.</summary>
[Fact]
public async Task CloseSessionAsync_AdminClosesSession()
{
@@ -40,6 +42,7 @@ public sealed class DashboardSessionAdminServiceTests
Assert.Equal("session-1", sessionManager.LastClosedSessionId);
}
/// <summary>Verifies that closing a missing session returns a friendly error message.</summary>
[Fact]
public async Task CloseSessionAsync_WhenSessionMissing_ReportsFriendlyError()
{
@@ -58,6 +61,7 @@ public sealed class DashboardSessionAdminServiceTests
Assert.Contains("not found", result.Message, StringComparison.OrdinalIgnoreCase);
}
/// <summary>Verifies that a viewer cannot kill a worker.</summary>
[Fact]
public async Task KillWorkerAsync_ViewerCannotManage()
{
@@ -73,6 +77,7 @@ public sealed class DashboardSessionAdminServiceTests
Assert.Equal(0, sessionManager.KillCount);
}
/// <summary>Verifies that an admin can kill a worker.</summary>
[Fact]
public async Task KillWorkerAsync_AdminKillsWorker()
{
@@ -95,6 +100,7 @@ public sealed class DashboardSessionAdminServiceTests
Assert.Equal("dashboard-admin-kill", sessionManager.LastKillReason);
}
/// <summary>Verifies that killing a worker with a blank session ID returns failure.</summary>
[Fact]
public async Task KillWorkerAsync_BlankSessionId_ReturnsFailure()
{
@@ -130,6 +136,7 @@ public sealed class DashboardSessionAdminServiceTests
Assert.Equal(0, sessionManager.CloseCount);
}
/// <summary>Verifies that CanManage rejects unauthenticated users and viewers.</summary>
[Fact]
public void CanManage_RejectsUnauthenticatedAndViewer()
{
@@ -209,22 +216,31 @@ public sealed class DashboardSessionAdminServiceTests
private sealed class FakeSessionManager : ISessionManager
{
/// <summary>Gets the number of times CloseSessionAsync was invoked.</summary>
public int CloseCount { get; private set; }
/// <summary>Gets the number of times KillWorkerAsync was invoked.</summary>
public int KillCount { get; private set; }
/// <summary>Gets the last session ID passed to CloseSessionAsync.</summary>
public string? LastClosedSessionId { get; private set; }
/// <summary>Gets the last session ID passed to KillWorkerAsync.</summary>
public string? LastKilledSessionId { get; private set; }
/// <summary>Gets the last reason string passed to KillWorkerAsync.</summary>
public string? LastKillReason { get; private set; }
/// <summary>Gets a value indicating whether CloseSessionAsync should throw SessionNotFound.</summary>
public bool CloseThrowsNotFound { get; init; }
/// <summary>Gets the exception CloseSessionAsync should throw unexpectedly.</summary>
public Exception? CloseThrowsUnexpected { get; init; }
/// <summary>Gets the exception KillWorkerAsync should throw unexpectedly.</summary>
public Exception? KillThrowsUnexpected { get; init; }
/// <inheritdoc />
public Task<GatewaySession> OpenSessionAsync(
SessionOpenRequest request,
string? clientIdentity,
@@ -233,6 +249,7 @@ public sealed class DashboardSessionAdminServiceTests
throw new NotSupportedException();
}
/// <inheritdoc />
public bool TryGetSession(
string sessionId,
[MaybeNullWhen(false)] out GatewaySession session)
@@ -241,6 +258,7 @@ public sealed class DashboardSessionAdminServiceTests
return false;
}
/// <inheritdoc />
public Task<WorkerCommandReply> InvokeAsync(
string sessionId,
WorkerCommand command,
@@ -249,6 +267,7 @@ public sealed class DashboardSessionAdminServiceTests
throw new NotSupportedException();
}
/// <inheritdoc />
public IAsyncEnumerable<WorkerEvent> ReadEventsAsync(
string sessionId,
CancellationToken cancellationToken)
@@ -256,6 +275,7 @@ public sealed class DashboardSessionAdminServiceTests
throw new NotSupportedException();
}
/// <inheritdoc />
public Task<SessionCloseResult> CloseSessionAsync(
string sessionId,
CancellationToken cancellationToken)
@@ -277,6 +297,7 @@ public sealed class DashboardSessionAdminServiceTests
return Task.FromResult(new SessionCloseResult(sessionId, SessionState.Closed, AlreadyClosed: false));
}
/// <inheritdoc />
public Task<SessionCloseResult> KillWorkerAsync(
string sessionId,
string reason,
@@ -293,6 +314,7 @@ public sealed class DashboardSessionAdminServiceTests
return Task.FromResult(new SessionCloseResult(sessionId, SessionState.Closed, AlreadyClosed: false));
}
/// <inheritdoc />
public Task<int> CloseExpiredLeasesAsync(
DateTimeOffset now,
CancellationToken cancellationToken)
@@ -300,6 +322,7 @@ public sealed class DashboardSessionAdminServiceTests
return Task.FromResult(0);
}
/// <inheritdoc />
public Task ShutdownAsync(CancellationToken cancellationToken)
{
return Task.CompletedTask;