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:
+22
@@ -17,8 +17,10 @@ public class CachingScriptMetadataResolverTests
|
||||
{
|
||||
public int MissingCalls;
|
||||
public int ReferenceCalls;
|
||||
/// <inheritdoc />
|
||||
public override bool ResolveMissingAssemblies => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override PortableExecutableReference? ResolveMissingAssembly(
|
||||
MetadataReference definition, AssemblyIdentity referenceIdentity)
|
||||
{
|
||||
@@ -26,6 +28,7 @@ public class CachingScriptMetadataResolverTests
|
||||
return MetadataReference.CreateFromFile(typeof(object).Assembly.Location);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ImmutableArray<PortableExecutableReference> ResolveReference(
|
||||
string reference, string? baseFilePath, MetadataReferenceProperties properties)
|
||||
{
|
||||
@@ -33,7 +36,9 @@ public class CachingScriptMetadataResolverTests
|
||||
return [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)];
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? other) => ReferenceEquals(this, other);
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode() => 0;
|
||||
}
|
||||
|
||||
@@ -41,8 +46,10 @@ public class CachingScriptMetadataResolverTests
|
||||
private sealed class NullReturningResolver : MetadataReferenceResolver
|
||||
{
|
||||
public int MissingCalls;
|
||||
/// <inheritdoc />
|
||||
public override bool ResolveMissingAssemblies => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override PortableExecutableReference? ResolveMissingAssembly(
|
||||
MetadataReference definition, AssemblyIdentity referenceIdentity)
|
||||
{
|
||||
@@ -50,11 +57,14 @@ public class CachingScriptMetadataResolverTests
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ImmutableArray<PortableExecutableReference> ResolveReference(
|
||||
string reference, string? baseFilePath, MetadataReferenceProperties properties)
|
||||
=> [];
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? other) => ReferenceEquals(this, other);
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode() => 0;
|
||||
}
|
||||
|
||||
@@ -62,6 +72,7 @@ public class CachingScriptMetadataResolverTests
|
||||
private static readonly MetadataReference SomeDefinition =
|
||||
MetadataReference.CreateFromFile(typeof(object).Assembly.Location);
|
||||
|
||||
/// <summary>Verifies that resolving the same identity twice resolves once and shares the instance.</summary>
|
||||
[Fact]
|
||||
public void ResolveMissingAssembly_SameIdentityTwice_ResolvesOnceAndSharesInstance()
|
||||
{
|
||||
@@ -75,6 +86,7 @@ public class CachingScriptMetadataResolverTests
|
||||
Assert.Same(first, second); // one AssemblyMetadata/PEReader/native block, not two
|
||||
}
|
||||
|
||||
/// <summary>Verifies that distinct identities are resolved independently.</summary>
|
||||
[Fact]
|
||||
public void ResolveMissingAssembly_DistinctIdentities_ResolveIndependently()
|
||||
{
|
||||
@@ -133,6 +145,7 @@ public class CachingScriptMetadataResolverTests
|
||||
Assert.Equal(1, inner.MissingCalls);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that resolving a reference twice with the same arguments resolves once and shares the instances.</summary>
|
||||
[Fact]
|
||||
public void ResolveReference_SameArgsTwice_ResolvesOnceAndSharesInstances()
|
||||
{
|
||||
@@ -146,10 +159,12 @@ public class CachingScriptMetadataResolverTests
|
||||
Assert.Same(first[0], second[0]);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the shared instance is a process-wide singleton.</summary>
|
||||
[Fact]
|
||||
public void Instance_IsProcessWideSingleton()
|
||||
=> Assert.Same(CachingScriptMetadataResolver.Instance, CachingScriptMetadataResolver.Instance);
|
||||
|
||||
/// <summary>Verifies that the resolve-missing-assemblies flag is delegated to the inner resolver.</summary>
|
||||
[Fact]
|
||||
public void ResolveMissingAssemblies_DelegatesToInner()
|
||||
{
|
||||
@@ -204,18 +219,25 @@ public class CachingScriptMetadataResolverTests
|
||||
{
|
||||
private readonly MetadataReferenceResolver _inner;
|
||||
public long MissingCalls;
|
||||
/// <summary>Initializes the probe around an inner resolver.</summary>
|
||||
/// <param name="inner">The resolver to delegate to.</param>
|
||||
public ProbeResolver(MetadataReferenceResolver inner) => _inner = inner;
|
||||
/// <inheritdoc />
|
||||
public override bool ResolveMissingAssemblies => _inner.ResolveMissingAssemblies;
|
||||
/// <inheritdoc />
|
||||
public override PortableExecutableReference? ResolveMissingAssembly(
|
||||
MetadataReference definition, AssemblyIdentity referenceIdentity)
|
||||
{
|
||||
Interlocked.Increment(ref MissingCalls);
|
||||
return _inner.ResolveMissingAssembly(definition, referenceIdentity);
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public override ImmutableArray<PortableExecutableReference> ResolveReference(
|
||||
string reference, string? baseFilePath, MetadataReferenceProperties properties)
|
||||
=> _inner.ResolveReference(reference, baseFilePath, properties);
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? other) => ReferenceEquals(this, other);
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode() => 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user