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:
@@ -19,7 +19,7 @@ public class CaptiveDependencyGuardSelfTests
|
||||
private interface IPretendScopedService;
|
||||
|
||||
/// <summary>
|
||||
/// POSITIVE CONTROL — the pre-row-45 shape, preserved permanently. An actor that caches a
|
||||
/// POSITIVE CONTROL — the original captive-dependency shape, preserved permanently. An actor that caches a
|
||||
/// scoped-typed service for its lifetime is exactly what <c>NotificationOutboxActor</c>
|
||||
/// looked like before 9e769735, and the guard must report it.
|
||||
/// </summary>
|
||||
@@ -67,6 +67,7 @@ public class CaptiveDependencyGuardSelfTests
|
||||
private static readonly IReadOnlySet<Type> PretendScopedSet =
|
||||
new HashSet<Type> { typeof(IPretendScopedService) };
|
||||
|
||||
/// <summary>Verifies that the guard flags an actor that caches a scoped service.</summary>
|
||||
[Fact]
|
||||
public void Guard_Flags_ActorCachingAScopedService()
|
||||
{
|
||||
@@ -78,6 +79,7 @@ public class CaptiveDependencyGuardSelfTests
|
||||
Assert.Equal(typeof(IPretendScopedService), violation.FieldType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the guard flags an actor that caches a service scope even when the scoped set is empty.</summary>
|
||||
[Fact]
|
||||
public void Guard_Flags_ActorCachingAServiceScope_EvenWhenTheScopedSetIsEmpty()
|
||||
{
|
||||
@@ -90,6 +92,7 @@ public class CaptiveDependencyGuardSelfTests
|
||||
Assert.Equal("_scope", violation.FieldName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the guard flags an actor that caches a DbContext.</summary>
|
||||
[Fact]
|
||||
public void Guard_Flags_ActorCachingADbContext()
|
||||
{
|
||||
@@ -100,6 +103,7 @@ public class CaptiveDependencyGuardSelfTests
|
||||
Assert.Equal(typeof(ScadaBridgeDbContext), violation.FieldType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the guard flags the compiler-generated backing field of an auto-property of a scoped type.</summary>
|
||||
[Fact]
|
||||
public void Guard_Flags_ScopedAutoPropertyBackingField()
|
||||
{
|
||||
@@ -110,6 +114,7 @@ public class CaptiveDependencyGuardSelfTests
|
||||
Assert.Contains("Captive", violation.FieldName, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the guard allows fields that hold the root provider or a scope factory.</summary>
|
||||
[Fact]
|
||||
public void Guard_Allows_RootProviderAndScopeFactoryFields()
|
||||
{
|
||||
@@ -252,6 +257,7 @@ public class CentralCaptiveDependencyGuardTests : IDisposable
|
||||
private readonly CentralDbTestEnvironment _dbEnv;
|
||||
private readonly List<ServiceDescriptor> _descriptors = [];
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>CentralCaptiveDependencyGuardTests</c> class.</summary>
|
||||
public CentralCaptiveDependencyGuardTests()
|
||||
{
|
||||
_previousEnv = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT");
|
||||
@@ -309,6 +315,7 @@ public class CentralCaptiveDependencyGuardTests : IDisposable
|
||||
_ = _factory.Server;
|
||||
}
|
||||
|
||||
/// <summary>Disposes the web application factory.</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
@@ -322,6 +329,7 @@ public class CentralCaptiveDependencyGuardTests : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that no actor in the central composition root holds captive scoped state.</summary>
|
||||
[Fact]
|
||||
public void Central_NoActorHoldsCaptiveScopedState()
|
||||
{
|
||||
@@ -352,6 +360,7 @@ public class SiteCaptiveDependencyGuardTests : IDisposable
|
||||
private readonly string _tempAuditDbPath;
|
||||
private readonly IServiceCollection _services;
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>SiteCaptiveDependencyGuardTests</c> class.</summary>
|
||||
public SiteCaptiveDependencyGuardTests()
|
||||
{
|
||||
_tempDbPath = Path.Combine(Path.GetTempPath(), $"sb_guard_{Guid.NewGuid()}.db");
|
||||
@@ -385,6 +394,7 @@ public class SiteCaptiveDependencyGuardTests : IDisposable
|
||||
_services = builder.Services;
|
||||
}
|
||||
|
||||
/// <summary>Deletes the temporary database files, ignoring failures.</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (var path in new[] { _tempDbPath, _tempTrackingDbPath, _tempLocalDbPath, _tempAuditDbPath })
|
||||
@@ -393,6 +403,7 @@ public class SiteCaptiveDependencyGuardTests : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that no actor in the site composition root holds captive scoped state.</summary>
|
||||
[Fact]
|
||||
public void Site_NoActorHoldsCaptiveScopedState()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user