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:
@@ -53,7 +53,8 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
private ActorSystem _actorSystem = null!;
|
||||
private CentralControlGrpcService _service = null!;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Starts the in-memory host, actor system and gRPC service under test.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
_actorSystem = ActorSystem.Create("centralcontrol-e2e-test");
|
||||
@@ -94,7 +95,8 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
_server = _host.GetTestServer();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Stops the host and actor system and releases test resources.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public async Task DisposeAsync()
|
||||
{
|
||||
await _host.StopAsync();
|
||||
@@ -118,6 +120,9 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
|
||||
// ---- Auth positives / negatives, all through the real pipeline ----
|
||||
|
||||
/// <summary>Verifies that site A's key presented for a foreign site is denied before any actor dispatch.</summary>
|
||||
/// <param name="rpc">The rpc.</param>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Theory]
|
||||
[InlineData("reconcile")]
|
||||
[InlineData("notification")]
|
||||
@@ -147,6 +152,8 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
Assert.Equal(0, Volatile.Read(ref _dispatches));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the correct site and key reach the service on a unary call.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task CorrectSiteAndKey_ReachesTheService_OnAUnaryCall()
|
||||
{
|
||||
@@ -157,6 +164,8 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
Assert.True(ack.Accepted);
|
||||
}
|
||||
|
||||
/// <summary>Verifies no credentials at all is rejected with permission denied.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task NoCredentialsAtAll_IsRejected_WithPermissionDenied()
|
||||
{
|
||||
@@ -168,6 +177,8 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
Assert.Equal(StatusCode.PermissionDenied, ex.StatusCode);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a wrong key for the site is rejected with a permission-denied status.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task WrongKeyForTheSite_IsRejected_WithPermissionDenied()
|
||||
{
|
||||
@@ -180,6 +191,8 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
Assert.Equal(StatusCode.PermissionDenied, ex.StatusCode);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an unknown site is rejected with a permission-denied status.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task UnknownSite_IsRejected_WithPermissionDenied()
|
||||
{
|
||||
@@ -191,6 +204,8 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
Assert.Equal(StatusCode.PermissionDenied, ex.StatusCode);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the accept and reject paths are distinguishable.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task TheAcceptAndRejectPathsAreDistinguishable()
|
||||
{
|
||||
@@ -207,6 +222,8 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
|
||||
// ---- One RPC per shape: unary (above) + the ingest bridge ----
|
||||
|
||||
/// <summary>Verifies that ingesting audit events decodes the batch, asks the ingest proxy and encodes the ack.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task IngestAuditEvents_DecodesTheBatch_AsksTheIngestProxy_EncodesTheAck()
|
||||
{
|
||||
@@ -224,6 +241,8 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
Assert.Contains(AcceptedId.ToString(), ack.AcceptedEventIds);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that ingesting an empty audit-event batch short-circuits without asking the ingest proxy.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task IngestAuditEvents_EmptyBatch_ShortCircuits_WithoutAskingTheIngestProxy()
|
||||
{
|
||||
@@ -259,17 +278,21 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
|
||||
private sealed class FixedPskProvider(string key) : ISitePskProvider
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public ValueTask<string> GetAsync(string siteId, CancellationToken ct) => new(key);
|
||||
/// <inheritdoc />
|
||||
public void Invalidate(string siteId) { }
|
||||
}
|
||||
|
||||
private sealed class MapPskProvider(IReadOnlyDictionary<string, string> keys) : ISitePskProvider
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public ValueTask<string> GetAsync(string siteId, CancellationToken ct)
|
||||
=> keys.TryGetValue(siteId, out var key)
|
||||
? new ValueTask<string>(key)
|
||||
: throw new InvalidOperationException($"no key for '{siteId}'");
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Invalidate(string siteId) { }
|
||||
}
|
||||
|
||||
@@ -280,6 +303,9 @@ public class CentralControlEndToEndTests : IAsyncLifetime
|
||||
/// </summary>
|
||||
private sealed class StubCentralActor : ReceiveActor
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <c>StubCentralActor</c> class.</summary>
|
||||
/// <param name="acceptedId">The accepted id.</param>
|
||||
/// <param name="dispatched">The dispatched.</param>
|
||||
public StubCentralActor(Guid acceptedId, Action dispatched)
|
||||
{
|
||||
Receive<NotificationSubmit>(msg => { dispatched();
|
||||
|
||||
Reference in New Issue
Block a user