docs: backfill XML documentation across 756 files
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>, <param>, <typeparam>, and <inheritdoc/> tags to public members surfaced by commentchecker — resolves 5,847 of 5,869 issues (99.6%) across three /fixdocs passes.
This commit is contained in:
@@ -10,11 +10,21 @@ public sealed class DriverHostTests
|
||||
{
|
||||
private sealed class StubDriver(string id, bool failInit = false) : IDriver
|
||||
{
|
||||
/// <summary>Gets the driver instance identifier.</summary>
|
||||
public string DriverInstanceId { get; } = id;
|
||||
|
||||
/// <summary>Gets the driver type name.</summary>
|
||||
public string DriverType => "Stub";
|
||||
|
||||
/// <summary>Gets a value indicating whether the driver has been initialized.</summary>
|
||||
public bool Initialized { get; private set; }
|
||||
|
||||
/// <summary>Gets a value indicating whether the driver has been shut down.</summary>
|
||||
public bool ShutDown { get; private set; }
|
||||
|
||||
/// <summary>Initializes the driver asynchronously.</summary>
|
||||
/// <param name="_">Configuration data (unused in stub).</param>
|
||||
/// <param name="ct">The cancellation token.</param>
|
||||
public Task InitializeAsync(string _, CancellationToken ct)
|
||||
{
|
||||
if (failInit) throw new InvalidOperationException("boom");
|
||||
@@ -22,14 +32,28 @@ public sealed class DriverHostTests
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>Reinitializes the driver asynchronously.</summary>
|
||||
/// <param name="_">Configuration data (unused in stub).</param>
|
||||
/// <param name="ct">The cancellation token.</param>
|
||||
public Task ReinitializeAsync(string _, CancellationToken ct) => Task.CompletedTask;
|
||||
|
||||
/// <summary>Shuts down the driver asynchronously.</summary>
|
||||
/// <param name="ct">The cancellation token.</param>
|
||||
public Task ShutdownAsync(CancellationToken ct) { ShutDown = true; return Task.CompletedTask; }
|
||||
|
||||
/// <summary>Gets the current health status of the driver.</summary>
|
||||
public DriverHealth GetHealth() =>
|
||||
new(Initialized ? DriverState.Healthy : DriverState.Unknown, null, null);
|
||||
|
||||
/// <summary>Gets the memory footprint of the driver.</summary>
|
||||
public long GetMemoryFootprint() => 0;
|
||||
|
||||
/// <summary>Flushes optional caches asynchronously.</summary>
|
||||
/// <param name="ct">The cancellation token.</param>
|
||||
public Task FlushOptionalCachesAsync(CancellationToken ct) => Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>Verifies that registering a driver initializes it and tracks its health.</summary>
|
||||
[Fact]
|
||||
public async Task Register_initializes_driver_and_tracks_health()
|
||||
{
|
||||
@@ -43,6 +67,7 @@ public sealed class DriverHostTests
|
||||
host.GetHealth("d-1")!.State.ShouldBe(DriverState.Healthy);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that registration rethrows initialization failures but keeps the driver registered.</summary>
|
||||
[Fact]
|
||||
public async Task Register_rethrows_init_failure_but_keeps_driver_registered()
|
||||
{
|
||||
@@ -55,6 +80,7 @@ public sealed class DriverHostTests
|
||||
host.RegisteredDriverIds.ShouldContain("d-bad");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that duplicate driver registration throws an exception.</summary>
|
||||
[Fact]
|
||||
public async Task Duplicate_registration_throws()
|
||||
{
|
||||
@@ -65,6 +91,7 @@ public sealed class DriverHostTests
|
||||
host.RegisterAsync(new StubDriver("d-1"), "{}", CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that unregistering a driver shuts it down and removes it.</summary>
|
||||
[Fact]
|
||||
public async Task Unregister_shuts_down_and_removes()
|
||||
{
|
||||
@@ -109,6 +136,7 @@ public sealed class DriverHostTests
|
||||
"RegisterAsync's awaited driver call must use ConfigureAwait(false) so the continuation does not post back to the captured context");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that UnregisterAsync does not capture the synchronization context.</summary>
|
||||
[Fact]
|
||||
public async Task UnregisterAsync_Does_Not_Capture_SynchronizationContext()
|
||||
{
|
||||
@@ -136,6 +164,7 @@ public sealed class DriverHostTests
|
||||
"UnregisterAsync's awaited shutdown call must use ConfigureAwait(false)");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that DisposeAsync does not capture the synchronization context.</summary>
|
||||
[Fact]
|
||||
public async Task DisposeAsync_Does_Not_Capture_SynchronizationContext()
|
||||
{
|
||||
@@ -196,14 +225,34 @@ public sealed class DriverHostTests
|
||||
/// <summary>Driver whose Initialize / Shutdown completions are caller-controlled via TCS.</summary>
|
||||
private sealed class TcsDriver(string id, TaskCompletionSource initTcs, TaskCompletionSource? shutdownTcs = null) : IDriver
|
||||
{
|
||||
/// <summary>Gets the driver instance identifier.</summary>
|
||||
public string DriverInstanceId { get; } = id;
|
||||
|
||||
/// <summary>Gets the driver type name.</summary>
|
||||
public string DriverType => "Tcs";
|
||||
|
||||
/// <summary>Initializes the driver asynchronously.</summary>
|
||||
/// <param name="_">Configuration data (unused in TCS driver).</param>
|
||||
/// <param name="ct">The cancellation token.</param>
|
||||
public Task InitializeAsync(string _, CancellationToken ct) => initTcs.Task;
|
||||
|
||||
/// <summary>Reinitializes the driver asynchronously.</summary>
|
||||
/// <param name="_">Configuration data (unused in TCS driver).</param>
|
||||
/// <param name="ct">The cancellation token.</param>
|
||||
public Task ReinitializeAsync(string _, CancellationToken ct) => Task.CompletedTask;
|
||||
|
||||
/// <summary>Shuts down the driver asynchronously.</summary>
|
||||
/// <param name="ct">The cancellation token.</param>
|
||||
public Task ShutdownAsync(CancellationToken ct) => (shutdownTcs ?? CompletedTcs).Task;
|
||||
|
||||
/// <summary>Gets the current health status of the driver.</summary>
|
||||
public DriverHealth GetHealth() => new(DriverState.Healthy, null, null);
|
||||
|
||||
/// <summary>Gets the memory footprint of the driver.</summary>
|
||||
public long GetMemoryFootprint() => 0;
|
||||
|
||||
/// <summary>Flushes optional caches asynchronously.</summary>
|
||||
/// <param name="ct">The cancellation token.</param>
|
||||
public Task FlushOptionalCachesAsync(CancellationToken ct) => Task.CompletedTask;
|
||||
|
||||
private static readonly TaskCompletionSource CompletedTcs = MakeCompleted();
|
||||
@@ -222,17 +271,28 @@ public sealed class DriverHostTests
|
||||
public int PostCount;
|
||||
public int SendCount;
|
||||
|
||||
/// <summary>Posts a callback to the work queue.</summary>
|
||||
/// <inheritdoc />
|
||||
public override void Post(SendOrPostCallback d, object? state)
|
||||
{
|
||||
Interlocked.Increment(ref PostCount);
|
||||
_queue.Enqueue(() => d(state));
|
||||
}
|
||||
|
||||
/// <summary>Sends a callback synchronously.</summary>
|
||||
/// <inheritdoc />
|
||||
public override void Send(SendOrPostCallback d, object? state)
|
||||
{
|
||||
Interlocked.Increment(ref SendCount);
|
||||
d(state);
|
||||
}
|
||||
|
||||
/// <summary>Attempts to dequeue a work item from the queue.</summary>
|
||||
/// <param name="work">The dequeued work item if one was available.</param>
|
||||
/// <returns>True if a work item was dequeued; otherwise false.</returns>
|
||||
public bool TryDequeue(out Action work) => _queue.TryDequeue(out work!);
|
||||
|
||||
/// <summary>Resets the post and send counts.</summary>
|
||||
public void Reset() { Interlocked.Exchange(ref PostCount, 0); Interlocked.Exchange(ref SendCount, 0); }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user