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:
@@ -15,6 +15,7 @@ public sealed class OrphanWorkerTerminatorTests
|
||||
{
|
||||
private const string WorkerExecutablePath = @"C:\app\src\ZB.MOM.WW.MxGateway.Worker\bin\x86\Release\ZB.MOM.WW.MxGateway.Worker.exe";
|
||||
|
||||
/// <summary>Verifies that orphan worker processes matching the configured executable path are killed.</summary>
|
||||
[Fact]
|
||||
public void TerminateOrphans_KillsWorkerProcessesMatchingConfiguredExecutablePath()
|
||||
{
|
||||
@@ -31,6 +32,7 @@ public sealed class OrphanWorkerTerminatorTests
|
||||
Assert.Equal([101, 102], inspector.KilledProcessIds.Order());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that orphan workers are killed when executable path is unreadable but image name matches.</summary>
|
||||
[Fact]
|
||||
public void TerminateOrphans_KillsImageNameMatchWhenExecutablePathUnreadable()
|
||||
{
|
||||
@@ -49,6 +51,7 @@ public sealed class OrphanWorkerTerminatorTests
|
||||
Assert.Equal([201], inspector.KilledProcessIds);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that unrelated processes with the same image name are not killed.</summary>
|
||||
[Fact]
|
||||
public void TerminateOrphans_DoesNotKillUnrelatedProcessSharingImageName()
|
||||
{
|
||||
@@ -66,6 +69,7 @@ public sealed class OrphanWorkerTerminatorTests
|
||||
Assert.Empty(inspector.KilledProcessIds);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the current process is not killed even if path matches.</summary>
|
||||
[Fact]
|
||||
public void TerminateOrphans_DoesNotKillCurrentProcess()
|
||||
{
|
||||
@@ -81,6 +85,7 @@ public sealed class OrphanWorkerTerminatorTests
|
||||
Assert.Empty(inspector.KilledProcessIds);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that termination continues when one process kill fails.</summary>
|
||||
[Fact]
|
||||
public void TerminateOrphans_ContinuesWhenOneKillThrows()
|
||||
{
|
||||
@@ -118,12 +123,18 @@ public sealed class OrphanWorkerTerminatorTests
|
||||
private sealed class FakeProcessInspector(IReadOnlyList<RunningProcessInfo> processes)
|
||||
: IRunningProcessInspector
|
||||
{
|
||||
/// <summary>Gets the list of killed process IDs.</summary>
|
||||
public List<int> KilledProcessIds { get; } = [];
|
||||
|
||||
/// <summary>Gets or sets the process ID that should throw when killed.</summary>
|
||||
public int? ThrowOnKillProcessId { get; init; }
|
||||
|
||||
/// <summary>Gets the list of running processes by name.</summary>
|
||||
/// <param name="processName">The process name to search for.</param>
|
||||
public IReadOnlyList<RunningProcessInfo> GetProcessesByName(string processName) => processes;
|
||||
|
||||
/// <summary>Kills the specified process or records the kill attempt.</summary>
|
||||
/// <param name="processId">The process identifier to kill.</param>
|
||||
public void Kill(int processId)
|
||||
{
|
||||
if (ThrowOnKillProcessId == processId)
|
||||
|
||||
@@ -247,6 +247,7 @@ public sealed class WorkerClientTests
|
||||
Assert.Equal(WorkerClientState.Faulted, client.State);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that pipe disconnect faults the client.</summary>
|
||||
[Fact]
|
||||
public async Task ReadLoop_WhenPipeDisconnects_FaultsClient()
|
||||
{
|
||||
@@ -767,23 +768,32 @@ public sealed class WorkerClientTests
|
||||
{
|
||||
private readonly TaskCompletionSource _exited = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
|
||||
/// <summary>Gets the process ID.</summary>
|
||||
public int Id { get; } = WorkerProcessId;
|
||||
|
||||
/// <summary>Gets a value indicating whether the process has exited.</summary>
|
||||
public bool HasExited { get; private set; }
|
||||
|
||||
/// <summary>Gets the process exit code.</summary>
|
||||
public int? ExitCode { get; private set; }
|
||||
|
||||
/// <summary>Gets the number of times kill was called.</summary>
|
||||
public int KillCount { get; private set; }
|
||||
|
||||
/// <summary>Gets the last kill request's entire process tree flag.</summary>
|
||||
public bool KillEntireProcessTree { get; private set; }
|
||||
|
||||
/// <summary>Gets a value indicating whether dispose was called.</summary>
|
||||
public bool Disposed { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValueTask WaitForExitAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
return new ValueTask(_exited.Task.WaitAsync(cancellationToken));
|
||||
}
|
||||
|
||||
/// <summary>Records a kill request.</summary>
|
||||
/// <param name="entireProcessTree">Whether to kill the entire process tree.</param>
|
||||
public void Kill(bool entireProcessTree)
|
||||
{
|
||||
KillCount++;
|
||||
@@ -793,6 +803,7 @@ public sealed class WorkerClientTests
|
||||
_exited.TrySetResult();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
Disposed = true;
|
||||
|
||||
@@ -17,6 +17,7 @@ public sealed class WorkerExecutableValidatorTests : IDisposable
|
||||
|
||||
private readonly List<string> _tempFiles = [];
|
||||
|
||||
/// <summary>Verifies that x86 executable matching required architecture does not throw.</summary>
|
||||
[Fact]
|
||||
public void Validate_X86ExecutableMatchingRequiredArchitecture_DoesNotThrow()
|
||||
{
|
||||
@@ -25,6 +26,7 @@ public sealed class WorkerExecutableValidatorTests : IDisposable
|
||||
WorkerExecutableValidator.Validate(path, WorkerArchitecture.X86);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that x64 executable matching required architecture does not throw.</summary>
|
||||
[Fact]
|
||||
public void Validate_X64ExecutableMatchingRequiredArchitecture_DoesNotThrow()
|
||||
{
|
||||
@@ -33,6 +35,7 @@ public sealed class WorkerExecutableValidatorTests : IDisposable
|
||||
WorkerExecutableValidator.Validate(path, WorkerArchitecture.X64);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that x64 executable when x86 required throws invalid executable.</summary>
|
||||
[Fact]
|
||||
public void Validate_X64ExecutableWhenX86Required_ThrowsInvalidExecutable()
|
||||
{
|
||||
@@ -45,6 +48,7 @@ public sealed class WorkerExecutableValidatorTests : IDisposable
|
||||
Assert.Contains("architecture", exception.Message, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that x86 executable when x64 required throws invalid executable.</summary>
|
||||
[Fact]
|
||||
public void Validate_X86ExecutableWhenX64Required_ThrowsInvalidExecutable()
|
||||
{
|
||||
@@ -56,6 +60,7 @@ public sealed class WorkerExecutableValidatorTests : IDisposable
|
||||
Assert.Equal(WorkerProcessLaunchErrorCode.InvalidExecutable, exception.ErrorCode);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that file without MZ header throws invalid executable.</summary>
|
||||
[Fact]
|
||||
public void Validate_FileWithoutMzHeader_ThrowsInvalidExecutable()
|
||||
{
|
||||
@@ -70,6 +75,7 @@ public sealed class WorkerExecutableValidatorTests : IDisposable
|
||||
Assert.Contains("MZ", exception.Message, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that file too small for PE header throws invalid executable.</summary>
|
||||
[Fact]
|
||||
public void Validate_FileTooSmallForPeHeader_ThrowsInvalidExecutable()
|
||||
{
|
||||
@@ -81,6 +87,7 @@ public sealed class WorkerExecutableValidatorTests : IDisposable
|
||||
Assert.Equal(WorkerProcessLaunchErrorCode.InvalidExecutable, exception.ErrorCode);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that file without PE signature throws invalid executable.</summary>
|
||||
[Fact]
|
||||
public void Validate_FileWithoutPeSignature_ThrowsInvalidExecutable()
|
||||
{
|
||||
@@ -122,6 +129,7 @@ public sealed class WorkerExecutableValidatorTests : IDisposable
|
||||
return path;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (string path in _tempFiles)
|
||||
|
||||
Reference in New Issue
Block a user