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:
@@ -187,35 +187,46 @@ public sealed class GatewaySessionTests
|
||||
private readonly TaskCompletionSource _shutdownStarted = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
private readonly TaskCompletionSource _shutdownReleased = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
|
||||
/// <summary>Gets the session identifier.</summary>
|
||||
public string SessionId { get; } = "session-test";
|
||||
|
||||
/// <summary>Gets the worker process identifier.</summary>
|
||||
public int? ProcessId { get; } = 1234;
|
||||
|
||||
/// <summary>Gets or sets the worker client state.</summary>
|
||||
public WorkerClientState State { get; private set; } = WorkerClientState.Ready;
|
||||
|
||||
/// <summary>Gets the last recorded heartbeat timestamp.</summary>
|
||||
public DateTimeOffset LastHeartbeatAt { get; } = DateTimeOffset.UtcNow;
|
||||
|
||||
/// <summary>Gets the count of shutdown invocations.</summary>
|
||||
public int ShutdownCount { get; private set; }
|
||||
|
||||
/// <summary>Gets the count of dispose invocations.</summary>
|
||||
public int DisposeCount { get; private set; }
|
||||
|
||||
/// <summary>Waits for shutdown to start.</summary>
|
||||
public Task WaitForShutdownStartAsync()
|
||||
{
|
||||
return _shutdownStarted.Task.WaitAsync(TimeSpan.FromSeconds(5));
|
||||
}
|
||||
|
||||
/// <summary>Releases the shutdown block.</summary>
|
||||
public void ReleaseShutdown()
|
||||
{
|
||||
_shutdownReleased.TrySetResult();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task StartAsync(CancellationToken cancellationToken) => Task.CompletedTask;
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<WorkerCommandReply> InvokeAsync(
|
||||
WorkerCommand command,
|
||||
TimeSpan timeout,
|
||||
CancellationToken cancellationToken) => Task.FromResult(new WorkerCommandReply());
|
||||
|
||||
/// <inheritdoc />
|
||||
public async IAsyncEnumerable<WorkerEvent> ReadEventsAsync(
|
||||
[EnumeratorCancellation] CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -223,6 +234,7 @@ public sealed class GatewaySessionTests
|
||||
yield break;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task ShutdownAsync(TimeSpan timeout, CancellationToken cancellationToken)
|
||||
{
|
||||
ShutdownCount++;
|
||||
@@ -231,11 +243,13 @@ public sealed class GatewaySessionTests
|
||||
State = WorkerClientState.Closed;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Kill(string reason)
|
||||
{
|
||||
State = WorkerClientState.Faulted;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
DisposeCount++;
|
||||
@@ -245,23 +259,31 @@ public sealed class GatewaySessionTests
|
||||
|
||||
private sealed class FakeWorkerClient : IWorkerClient
|
||||
{
|
||||
/// <summary>Gets the session identifier.</summary>
|
||||
public string SessionId { get; } = "session-test";
|
||||
|
||||
/// <summary>Gets the worker process identifier.</summary>
|
||||
public int? ProcessId { get; } = 1234;
|
||||
|
||||
/// <summary>Gets the worker client state.</summary>
|
||||
public WorkerClientState State { get; } = WorkerClientState.Ready;
|
||||
|
||||
/// <summary>Gets the last recorded heartbeat timestamp.</summary>
|
||||
public DateTimeOffset LastHeartbeatAt { get; } = DateTimeOffset.UtcNow;
|
||||
|
||||
/// <summary>Gets the count of dispose invocations.</summary>
|
||||
public int DisposeCount { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task StartAsync(CancellationToken cancellationToken) => Task.CompletedTask;
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<WorkerCommandReply> InvokeAsync(
|
||||
WorkerCommand command,
|
||||
TimeSpan timeout,
|
||||
CancellationToken cancellationToken) => Task.FromResult(new WorkerCommandReply());
|
||||
|
||||
/// <inheritdoc />
|
||||
public async IAsyncEnumerable<WorkerEvent> ReadEventsAsync(
|
||||
[EnumeratorCancellation] CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -269,12 +291,15 @@ public sealed class GatewaySessionTests
|
||||
yield break;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task ShutdownAsync(TimeSpan timeout, CancellationToken cancellationToken) => Task.CompletedTask;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Kill(string reason)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
DisposeCount++;
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace ZB.MOM.WW.MxGateway.Tests.Gateway.Sessions;
|
||||
/// </summary>
|
||||
public sealed class SessionManagerBulkTests
|
||||
{
|
||||
/// <summary>Verifies that AddItemBulkAsync forwards the command and returns results.</summary>
|
||||
[Fact]
|
||||
public async Task AddItemBulkAsync_ForwardsOneAddItemBulkCommandAndReturnsResults()
|
||||
{
|
||||
@@ -48,6 +49,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.Equal("invalid tag", results[1].ErrorMessage);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that AddItemBulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task AddItemBulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -60,6 +62,7 @@ public sealed class SessionManagerBulkTests
|
||||
async () => await session.AddItemBulkAsync(12, ["Tag.A"], cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that AdviseItemBulkAsync forwards the command and returns results.</summary>
|
||||
[Fact]
|
||||
public async Task AdviseItemBulkAsync_ForwardsOneAdviseItemBulkCommandAndReturnsResults()
|
||||
{
|
||||
@@ -86,6 +89,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.False(results[1].WasSuccessful);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that AdviseItemBulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task AdviseItemBulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -98,6 +102,7 @@ public sealed class SessionManagerBulkTests
|
||||
async () => await session.AdviseItemBulkAsync(12, [101], cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that RemoveItemBulkAsync forwards the command and returns results.</summary>
|
||||
[Fact]
|
||||
public async Task RemoveItemBulkAsync_ForwardsOneRemoveItemBulkCommandAndReturnsResults()
|
||||
{
|
||||
@@ -122,6 +127,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.False(results[1].WasSuccessful);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that RemoveItemBulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task RemoveItemBulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -134,6 +140,7 @@ public sealed class SessionManagerBulkTests
|
||||
async () => await session.RemoveItemBulkAsync(12, [11], cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that UnAdviseItemBulkAsync forwards the command and returns results.</summary>
|
||||
[Fact]
|
||||
public async Task UnAdviseItemBulkAsync_ForwardsOneUnAdviseItemBulkCommandAndReturnsResults()
|
||||
{
|
||||
@@ -159,6 +166,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.Equal("not advised", results[1].ErrorMessage);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that UnAdviseItemBulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task UnAdviseItemBulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -171,6 +179,7 @@ public sealed class SessionManagerBulkTests
|
||||
async () => await session.UnAdviseItemBulkAsync(12, [21], cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that SubscribeBulkAsync surfaces per-entry failures.</summary>
|
||||
[Fact]
|
||||
public async Task SubscribeBulkAsync_SurfacesPerEntryFailures()
|
||||
{
|
||||
@@ -198,6 +207,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.Equal("MXAccess subscribe failed", results[1].ErrorMessage);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that SubscribeBulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task SubscribeBulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -210,6 +220,7 @@ public sealed class SessionManagerBulkTests
|
||||
async () => await session.SubscribeBulkAsync(12, ["Tag"], cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that UnsubscribeBulkAsync forwards the command and returns results.</summary>
|
||||
[Fact]
|
||||
public async Task UnsubscribeBulkAsync_ForwardsOneUnsubscribeBulkCommandAndReturnsResults()
|
||||
{
|
||||
@@ -234,6 +245,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.False(results[1].WasSuccessful);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that UnsubscribeBulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task UnsubscribeBulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -246,6 +258,7 @@ public sealed class SessionManagerBulkTests
|
||||
async () => await session.UnsubscribeBulkAsync(12, [31], cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that WriteBulkAsync surfaces per-entry failures.</summary>
|
||||
[Fact]
|
||||
public async Task WriteBulkAsync_SurfacesPerEntryFailures()
|
||||
{
|
||||
@@ -278,6 +291,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.Equal("MXAccess invalid handle", results[1].ErrorMessage);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that WriteBulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task WriteBulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -293,6 +307,7 @@ public sealed class SessionManagerBulkTests
|
||||
cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that Write2BulkAsync forwards the command and preserves timestamp payload.</summary>
|
||||
[Fact]
|
||||
public async Task Write2BulkAsync_ForwardsOneWrite2BulkCommandAndPreservesTimestampPayload()
|
||||
{
|
||||
@@ -335,6 +350,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.False(results[1].WasSuccessful);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that Write2BulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task Write2BulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -359,6 +375,7 @@ public sealed class SessionManagerBulkTests
|
||||
cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that WriteSecuredBulkAsync forwards the command and preserves credential payload.</summary>
|
||||
[Fact]
|
||||
public async Task WriteSecuredBulkAsync_ForwardsOneWriteSecuredBulkCommandAndPreservesCredentialPayload()
|
||||
{
|
||||
@@ -409,6 +426,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.Equal("MXAccess secured-write rejected", results[1].ErrorMessage);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that WriteSecuredBulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task WriteSecuredBulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -480,6 +498,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.Equal(1, workerClient.InvokeCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that WriteSecured2BulkAsync forwards the command and preserves credential and timestamp payload.</summary>
|
||||
[Fact]
|
||||
public async Task WriteSecured2BulkAsync_ForwardsOneWriteSecured2BulkCommandAndPreservesCredentialAndTimestampPayload()
|
||||
{
|
||||
@@ -527,6 +546,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.False(results[1].WasSuccessful);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that WriteSecured2BulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task WriteSecured2BulkAsync_PropagatesCancellation()
|
||||
{
|
||||
@@ -552,6 +572,7 @@ public sealed class SessionManagerBulkTests
|
||||
cts.Token));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that ReadBulkAsync surfaces per-entry failures.</summary>
|
||||
[Fact]
|
||||
public async Task ReadBulkAsync_SurfacesPerEntryFailures()
|
||||
{
|
||||
@@ -597,6 +618,7 @@ public sealed class SessionManagerBulkTests
|
||||
Assert.Equal("MXAccess read timed out", results[1].ErrorMessage);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that ReadBulkAsync propagates cancellation.</summary>
|
||||
[Fact]
|
||||
public async Task ReadBulkAsync_PropagatesCancellation()
|
||||
{
|
||||
|
||||
@@ -50,6 +50,7 @@ public sealed class SessionManagerTests
|
||||
Assert.Equal(clock.GetUtcNow() + TimeSpan.FromMinutes(30), session.LeaseExpiresAt);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that session generation creates client correlation ID from client name and session ID.</summary>
|
||||
[Fact]
|
||||
public async Task OpenSessionAsync_GeneratesClientCorrelationIdFromClientNameAndSessionId()
|
||||
{
|
||||
@@ -124,6 +125,7 @@ public sealed class SessionManagerTests
|
||||
Assert.True(session.LeaseExpiresAt > DateTimeOffset.UtcNow);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that gateway session subscribe bulk forwards one bulk command and returns results.</summary>
|
||||
[Fact]
|
||||
public async Task GatewaySessionSubscribeBulkAsync_ForwardsOneBulkCommandAndReturnsResults()
|
||||
{
|
||||
@@ -168,6 +170,7 @@ public sealed class SessionManagerTests
|
||||
Assert.Equal(["Galaxy.Tag.Value"], workerClient.LastCommand?.Command.SubscribeBulk.TagAddresses);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that gateway session write bulk forwards one bulk command and returns results.</summary>
|
||||
[Fact]
|
||||
public async Task GatewaySessionWriteBulkAsync_ForwardsOneBulkCommandAndReturnsResults()
|
||||
{
|
||||
@@ -232,6 +235,7 @@ public sealed class SessionManagerTests
|
||||
Assert.Equal(2, workerClient.LastCommand?.Command.WriteBulk.Entries.Count);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that gateway session read bulk forwards one bulk command and returns results.</summary>
|
||||
[Fact]
|
||||
public async Task GatewaySessionReadBulkAsync_ForwardsOneBulkCommandAndReturnsResults()
|
||||
{
|
||||
@@ -497,6 +501,7 @@ public sealed class SessionManagerTests
|
||||
/// <see cref="ArgumentException.ThrowIfNullOrWhiteSpace"/>. A blank or whitespace reason must throw
|
||||
/// <see cref="ArgumentException"/> before any session lookup or worker call runs.
|
||||
/// </summary>
|
||||
/// <param name="blankReason">A blank or whitespace reason string.</param>
|
||||
[Theory]
|
||||
[InlineData("")]
|
||||
[InlineData(" ")]
|
||||
@@ -710,6 +715,7 @@ public sealed class SessionManagerTests
|
||||
Assert.Equal(0, workerClient.ShutdownCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that shutdown closes all registered sessions.</summary>
|
||||
[Fact]
|
||||
public async Task ShutdownAsync_ClosesAllRegisteredSessions()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user