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:
@@ -26,11 +26,20 @@ public class SitePskProviderTests
|
||||
private sealed class StaticOptionsMonitor(CommunicationOptions value)
|
||||
: IOptionsMonitor<CommunicationOptions>
|
||||
{
|
||||
/// <summary>Gets the fixed options instance.</summary>
|
||||
public CommunicationOptions CurrentValue => value;
|
||||
/// <summary>Returns the fixed options instance regardless of name.</summary>
|
||||
/// <param name="name">The named-options key, ignored.</param>
|
||||
/// <returns>The fixed options instance.</returns>
|
||||
public CommunicationOptions Get(string? name) => value;
|
||||
/// <summary>Does nothing; the fake never raises change notifications.</summary>
|
||||
/// <param name="listener">The change listener, ignored.</param>
|
||||
/// <returns>Always null.</returns>
|
||||
public IDisposable? OnChange(Action<CommunicationOptions, string?> listener) => null;
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the key is resolved from the secret store under the site-qualified name.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task ResolvesFromTheSecretStore_UnderTheSiteQualifiedName()
|
||||
{
|
||||
@@ -43,6 +52,8 @@ public class SitePskProviderTests
|
||||
Assert.Equal("key-for-a", psk);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a configured key map takes precedence so a host without a master key can still dial.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task ConfiguredMapWins_SoAHostWithNoMasterKeyCanStillDial()
|
||||
{
|
||||
@@ -62,6 +73,8 @@ public class SitePskProviderTests
|
||||
await resolver.DidNotReceive().GetAsync(Arg.Any<SecretName>(), Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the store is still consulted for a site missing from the configured map.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task StoreIsStillConsulted_ForASiteMissingFromTheMap()
|
||||
{
|
||||
@@ -78,6 +91,8 @@ public class SitePskProviderTests
|
||||
Assert.Equal("key-for-b", psk);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a missing secret throws and never yields an empty key.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task MissingSecret_Throws_AndNeverYieldsAnEmptyKey()
|
||||
{
|
||||
@@ -95,6 +110,8 @@ public class SitePskProviderTests
|
||||
Assert.Contains("SitePsks", ex.Message);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an empty secret is treated as missing.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task EmptySecret_IsTreatedAsMissing()
|
||||
{
|
||||
@@ -105,6 +122,8 @@ public class SitePskProviderTests
|
||||
async () => await Create(resolver).GetAsync("site-a", CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a faulting store surfaces as a key-not-configured error rather than a crypto error.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task AFaultingStore_SurfacesAsKeyNotConfigured_NotAsACryptoError()
|
||||
{
|
||||
@@ -120,6 +139,8 @@ public class SitePskProviderTests
|
||||
Assert.Contains("SB-GRPC-PSK-site-a", ex.Message);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that successful resolves are cached so not every call hits the store.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task SuccessfulResolvesAreCached_SoEveryCallDoesNotHitTheStore()
|
||||
{
|
||||
@@ -134,6 +155,8 @@ public class SitePskProviderTests
|
||||
await resolver.Received(1).GetAsync(Arg.Any<SecretName>(), Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that failures are not cached so a newly seeded key is picked up without a restart.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task FailuresAreNotCached_SoASeededKeyIsPickedUpWithoutARestart()
|
||||
{
|
||||
@@ -148,6 +171,8 @@ public class SitePskProviderTests
|
||||
Assert.Equal("seeded-later", await provider.GetAsync("site-a", CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that invalidating drops the cached key so a rotated key is read.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Invalidate_DropsTheCachedKey_SoARotatedKeyIsRead()
|
||||
{
|
||||
@@ -162,6 +187,8 @@ public class SitePskProviderTests
|
||||
Assert.Equal("rotated", await provider.GetAsync("site-a", CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that keys are scoped per site so one site never presents another site's key.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task KeysAreScopedPerSite_SoOneSiteNeverPresentsAnothersKey()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user