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:
@@ -44,10 +44,11 @@ public sealed class SimulatedDataConnection : IDataConnection, IBatchSubscribabl
|
||||
/// <summary>Key under which the connection name travels in the connection details.</summary>
|
||||
public const string ConnectionNameKey = "connectionName";
|
||||
|
||||
// Gets the current health of the simulated connection.
|
||||
/// <inheritdoc />
|
||||
public ConnectionHealth Status { get; private set; } = ConnectionHealth.Disconnected;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Raised when the simulated connection is disconnected.</summary>
|
||||
public event Action? Disconnected;
|
||||
|
||||
/// <summary>
|
||||
@@ -60,6 +61,7 @@ public sealed class SimulatedDataConnection : IDataConnection, IBatchSubscribabl
|
||||
/// <summary>Number of tag paths this connection has accepted subscriptions for.</summary>
|
||||
public int SubscribedTagCount => _subscriptionCounter;
|
||||
|
||||
// Marks the connection as connected and records the connection name from the details, if present.
|
||||
/// <inheritdoc />
|
||||
public Task ConnectAsync(IDictionary<string, string> connectionDetails, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@@ -70,6 +72,7 @@ public sealed class SimulatedDataConnection : IDataConnection, IBatchSubscribabl
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
// Marks the connection as disconnected and raises the Disconnected event.
|
||||
/// <inheritdoc />
|
||||
public Task DisconnectAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
@@ -78,6 +81,7 @@ public sealed class SimulatedDataConnection : IDataConnection, IBatchSubscribabl
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
// Captures the callback and returns a new subscription id.
|
||||
/// <inheritdoc />
|
||||
public Task<string> SubscribeAsync(string tagPath, SubscriptionCallback callback, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@@ -85,6 +89,7 @@ public sealed class SimulatedDataConnection : IDataConnection, IBatchSubscribabl
|
||||
return Task.FromResult($"sub-{Interlocked.Increment(ref _subscriptionCounter)}");
|
||||
}
|
||||
|
||||
// Captures the callback and accepts every tag path in the batch.
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<TagSubscribeResult>> SubscribeBatchAsync(
|
||||
IReadOnlyList<string> tagPaths,
|
||||
@@ -102,18 +107,22 @@ public sealed class SimulatedDataConnection : IDataConnection, IBatchSubscribabl
|
||||
return Task.FromResult<IReadOnlyList<TagSubscribeResult>>(results);
|
||||
}
|
||||
|
||||
// Does nothing; the simulated connection keeps no per-subscription state.
|
||||
/// <inheritdoc />
|
||||
public Task UnsubscribeAsync(string subscriptionId, CancellationToken cancellationToken = default)
|
||||
=> Task.CompletedTask;
|
||||
|
||||
// Does nothing; the simulated connection keeps no per-subscription state.
|
||||
/// <inheritdoc />
|
||||
public Task UnsubscribeBatchAsync(IReadOnlyList<string> subscriptionIds, CancellationToken cancellationToken = default)
|
||||
=> Task.CompletedTask;
|
||||
|
||||
// Returns a good-quality zero value for any tag.
|
||||
/// <inheritdoc />
|
||||
public Task<ReadResult> ReadAsync(string tagPath, CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(new ReadResult(true, new TagValue(0d, QualityCode.Good, DateTimeOffset.UtcNow), null));
|
||||
|
||||
// Returns a good-quality zero value for every requested tag.
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyDictionary<string, ReadResult>> ReadBatchAsync(
|
||||
IEnumerable<string> tagPaths, CancellationToken cancellationToken = default)
|
||||
@@ -126,10 +135,12 @@ public sealed class SimulatedDataConnection : IDataConnection, IBatchSubscribabl
|
||||
return Task.FromResult<IReadOnlyDictionary<string, ReadResult>>(results);
|
||||
}
|
||||
|
||||
// Accepts the write without storing it.
|
||||
/// <inheritdoc />
|
||||
public Task<WriteResult> WriteAsync(string tagPath, object? value, CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(new WriteResult(true, null));
|
||||
|
||||
// Accepts every write in the batch without storing it.
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyDictionary<string, WriteResult>> WriteBatchAsync(
|
||||
IDictionary<string, object?> values, CancellationToken cancellationToken = default)
|
||||
@@ -141,6 +152,7 @@ public sealed class SimulatedDataConnection : IDataConnection, IBatchSubscribabl
|
||||
return Task.FromResult<IReadOnlyDictionary<string, WriteResult>>(results);
|
||||
}
|
||||
|
||||
// Accepts the batch and reports that the awaited response matched immediately.
|
||||
/// <inheritdoc />
|
||||
public Task<bool> WriteBatchAndWaitAsync(
|
||||
IDictionary<string, object?> values, string flagPath, object? flagValue,
|
||||
@@ -148,6 +160,7 @@ public sealed class SimulatedDataConnection : IDataConnection, IBatchSubscribabl
|
||||
CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(true);
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Releases the connection; the simulated connection holds no resources.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user