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:
Joseph Doherty
2026-10-07 15:05:49 -04:00
parent 0ffd4bdbea
commit 513fa1aa16
998 changed files with 17896 additions and 2395 deletions
@@ -69,7 +69,10 @@ public sealed class BundleImporterLoadTests
private sealed class TestTimeProvider : TimeProvider
{
private DateTimeOffset _now;
/// <summary>Initializes the provider at the given start time.</summary>
/// <param name="start">The initial UTC time.</param>
public TestTimeProvider(DateTimeOffset start) { _now = start; }
/// <inheritdoc />
public override DateTimeOffset GetUtcNow() => _now;
}
@@ -159,6 +162,8 @@ public sealed class BundleImporterLoadTests
return serializer.Pack(content, manifest, passphrase, encryptor);
}
/// <summary>Verifies that loading an unencrypted bundle returns a session.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_returns_session_for_unencrypted_bundle()
{
@@ -176,6 +181,8 @@ public sealed class BundleImporterLoadTests
Assert.NotNull(rig.SessionStore.Get(session.SessionId));
}
/// <summary>Verifies that loading an encrypted bundle with the correct passphrase returns a session.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_returns_session_for_encrypted_bundle_with_correct_passphrase()
{
@@ -197,6 +204,8 @@ public sealed class BundleImporterLoadTests
Assert.Equal("Pump", roundTripped.Templates[0].Name);
}
/// <summary>Verifies that loading throws when the passphrase is wrong.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_throws_when_passphrase_wrong()
{
@@ -210,6 +219,8 @@ public sealed class BundleImporterLoadTests
() => rig.Importer.LoadAsync(stream, passphrase: "wrong"));
}
/// <summary>Verifies that the bundle is locked after three wrong passphrases, even across callers.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_locks_bundle_after_three_wrong_passphrases_even_across_callers()
{
@@ -245,6 +256,8 @@ public sealed class BundleImporterLoadTests
() => rig.Importer.LoadAsync(new MemoryStream(bundleBytes), passphrase: "correct"));
}
/// <summary>Verifies that loading rejects a bundle with too many entries.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_rejects_bundle_with_too_many_entries()
{
@@ -261,6 +274,8 @@ public sealed class BundleImporterLoadTests
() => rig.Importer.LoadAsync(new MemoryStream(paddedBytes), passphrase: null));
}
/// <summary>Verifies that loading rejects a bundle with an oversized entry.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_rejects_bundle_with_oversized_entry()
{
@@ -277,6 +292,8 @@ public sealed class BundleImporterLoadTests
() => rig.Importer.LoadAsync(new MemoryStream(oversizedBytes), passphrase: null));
}
/// <summary>Verifies that loading rejects a bundle whose entry exceeds the compression ratio.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_rejects_bundle_whose_entry_exceeds_compression_ratio()
{
@@ -352,13 +369,15 @@ public sealed class BundleImporterLoadTests
return output.ToArray();
}
/// <summary>Verifies that loading rejects a bundle with a tampered manifest field even with the correct passphrase.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_rejects_bundle_with_tampered_manifest_field_even_with_correct_passphrase()
{
// T-005: a stolen bundle whose plaintext manifest fields (SourceEnvironment,
// ExportedBy, …) have been edited must fail decryption with a tag mismatch.
// Without AAD an attacker could rewrite the SourceEnvironment label and slip
// past the Step-4 typo-resistant confirmation gate. We tamper the field by
// past the typo-resistant confirmation gate. We tamper the field by
// re-packing the manifest (with everything else, including the original
// ciphertext, unchanged) into a fresh ZIP and verify decrypt fails.
var rig = BuildRig();
@@ -405,6 +424,8 @@ public sealed class BundleImporterLoadTests
() => rig.Importer.LoadAsync(tamperedZipBytes, passphrase: "correct"));
}
/// <summary>Verifies that loading resets the unlock counter on the correct passphrase.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_resets_unlock_counter_on_correct_passphrase()
{
@@ -429,6 +450,8 @@ public sealed class BundleImporterLoadTests
Assert.Equal(1, rig.SessionStore.GetUnlockFailureCount(session.Manifest.ContentHash));
}
/// <summary>Verifies that loading throws a not-supported error when the bundle format version is unsupported.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_throws_NotSupportedException_when_bundleFormatVersion_unsupported()
{
@@ -458,6 +481,8 @@ public sealed class BundleImporterLoadTests
() => rig.Importer.LoadAsync(bundleStream, passphrase: null));
}
/// <summary>Verifies that loading throws an invalid-data error when the content hash does not match.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_throws_InvalidDataException_when_content_hash_mismatch()
{
@@ -488,6 +513,8 @@ public sealed class BundleImporterLoadTests
Assert.Contains("hash", ex.Message, StringComparison.OrdinalIgnoreCase);
}
/// <summary>Verifies that loading throws an invalid-operation error when the bundle exceeds the size cap.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_throws_InvalidOperationException_when_bundle_exceeds_size_cap()
{
@@ -508,6 +535,8 @@ public sealed class BundleImporterLoadTests
// invoked, so these all passed-by-doing-nothing before the wiring.
// ─────────────────────────────────────────────────────────────────────
/// <summary>Verifies that loading rejects unlock attempts past the per-IP hourly cap.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task LoadAsync_rejects_unlock_attempts_past_the_per_ip_hourly_cap()
{
@@ -542,6 +571,8 @@ public sealed class BundleImporterLoadTests
new MemoryStream(bundleBytes), passphrase: "correct", clientKey: "10.1.1.5"));
}
/// <summary>Verifies that a throttled unlock is not counted as a passphrase failure and burns no strike.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Throttled_unlock_is_not_a_passphrase_failure_and_burns_no_strike()
{
@@ -571,6 +602,8 @@ public sealed class BundleImporterLoadTests
Assert.Equal(1, rig.SessionStore.GetUnlockFailureCount(contentHash));
}
/// <summary>Verifies that the unlock throttle is isolated per client.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Unlock_throttle_is_isolated_per_client()
{
@@ -598,6 +631,8 @@ public sealed class BundleImporterLoadTests
new MemoryStream(bundleBytes), passphrase: "wrong", clientKey: "10.1.1.8"));
}
/// <summary>Verifies that unattributed callers share one throttle bucket rather than bypassing it.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Unattributed_callers_share_one_throttle_bucket_rather_than_bypassing_it()
{
@@ -623,6 +658,8 @@ public sealed class BundleImporterLoadTests
Assert.Equal(BundleImporter.UnattributedClientKey, throttled.ClientKey);
}
/// <summary>Verifies that unencrypted bundles do not consume the unlock budget.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Unencrypted_bundles_do_not_consume_the_unlock_budget()
{
@@ -641,6 +678,8 @@ public sealed class BundleImporterLoadTests
}
}
/// <summary>Verifies that an already-locked bundle does not spend the client's hourly budget.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task An_already_locked_bundle_does_not_spend_the_clients_hourly_budget()
{
@@ -683,6 +722,8 @@ public sealed class BundleImporterLoadTests
// Register row 43 — abandoned-session release.
// ─────────────────────────────────────────────────────────────────────
/// <summary>Verifies that abandoning a session releases its slot and zeroes its decrypted content.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Abandon_releases_the_session_slot_and_zeroes_its_decrypted_content()
{
@@ -708,6 +749,8 @@ public sealed class BundleImporterLoadTests
Assert.All(decrypted, b => Assert.Equal(0, b));
}
/// <summary>Verifies that abandoning a session is idempotent and tolerates unknown ids.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Abandon_is_idempotent_and_tolerates_unknown_ids()
{
@@ -724,6 +767,8 @@ public sealed class BundleImporterLoadTests
Assert.Null(rig.SessionStore.Get(session.SessionId));
}
/// <summary>Verifies that abandoning a session does not release another caller's session.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Abandon_does_not_release_another_callers_session()
{
@@ -743,6 +788,8 @@ public sealed class BundleImporterLoadTests
Assert.NotEmpty(survivor!.DecryptedContent);
}
/// <summary>Verifies that abandoning a session frees a concurrent import session slot.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Abandon_frees_a_concurrent_import_session_slot()
{