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:
+27
-2
@@ -10,8 +10,7 @@ using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
|
||||
namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Redaction;
|
||||
|
||||
/// <summary>
|
||||
/// Guards the fail-closed contract for unavailable redactor patterns
|
||||
/// (Gitea #35).
|
||||
/// Guards the fail-closed contract for unavailable redactor patterns.
|
||||
///
|
||||
/// <para>
|
||||
/// <b>The defect.</b> <see cref="AuditRegexCache"/> rejects a pattern that is
|
||||
@@ -118,6 +117,7 @@ public class AuditRedactorFailClosedTests
|
||||
Assert.Equal(0, counter.Count);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an unavailable global body redactor suppresses the payload rather than emitting it raw.</summary>
|
||||
[Fact]
|
||||
public void UnavailableGlobalBodyRedactor_SuppressesPayload_RatherThanEmittingItRaw()
|
||||
{
|
||||
@@ -152,6 +152,7 @@ public class AuditRedactorFailClosedTests
|
||||
Assert.Equal(1, counter.Count);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an unavailable per-target body redactor suppresses the payload.</summary>
|
||||
[Fact]
|
||||
public void UnavailablePerTargetBodyRedactor_SuppressesPayload()
|
||||
{
|
||||
@@ -267,16 +268,27 @@ public class AuditRedactorFailClosedTests
|
||||
private sealed class CountingCounter : IAuditRedactionFailureCounter
|
||||
{
|
||||
private int _count;
|
||||
/// <summary>Gets the number of redaction failures counted so far.</summary>
|
||||
public int Count => Volatile.Read(ref _count);
|
||||
/// <inheritdoc />
|
||||
public void Increment() => Interlocked.Increment(ref _count);
|
||||
}
|
||||
|
||||
private sealed class StaticMonitor : IOptionsMonitor<AuditLogOptions>
|
||||
{
|
||||
private readonly AuditLogOptions _value;
|
||||
/// <summary>Initializes the monitor with a fixed options value.</summary>
|
||||
/// <param name="value">The value.</param>
|
||||
public StaticMonitor(AuditLogOptions value) => _value = value;
|
||||
/// <summary>Gets the current options value.</summary>
|
||||
public AuditLogOptions CurrentValue => _value;
|
||||
/// <summary>Returns the current options value regardless of the name.</summary>
|
||||
/// <param name="name">The options name; ignored.</param>
|
||||
/// <returns>The current options value.</returns>
|
||||
public AuditLogOptions Get(string? name) => _value;
|
||||
/// <summary>Registers a listener to be notified when the options change.</summary>
|
||||
/// <param name="listener">The change callback.</param>
|
||||
/// <returns>A disposable that removes the listener, or null when none is tracked.</returns>
|
||||
public IDisposable? OnChange(Action<AuditLogOptions, string?> listener) => null;
|
||||
}
|
||||
|
||||
@@ -286,10 +298,14 @@ public class AuditRedactorFailClosedTests
|
||||
private readonly List<Action<AuditLogOptions, string?>> _listeners = new();
|
||||
private int _reads;
|
||||
|
||||
/// <summary>Initializes the monitor with an initial options value.</summary>
|
||||
/// <param name="value">The value.</param>
|
||||
public MutableMonitor(AuditLogOptions value) => _value = value;
|
||||
|
||||
/// <summary>Gets the number of times <c>CurrentValue</c> has been read.</summary>
|
||||
public int CurrentValueReads => Volatile.Read(ref _reads);
|
||||
|
||||
/// <summary>Gets the current options value.</summary>
|
||||
public AuditLogOptions CurrentValue
|
||||
{
|
||||
get
|
||||
@@ -299,8 +315,14 @@ public class AuditRedactorFailClosedTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the current options value.</summary>
|
||||
/// <param name="name">The options name (ignored).</param>
|
||||
/// <returns>The current options value.</returns>
|
||||
public AuditLogOptions Get(string? name) => CurrentValue;
|
||||
|
||||
/// <summary>Registers a listener to be notified when the options change.</summary>
|
||||
/// <param name="listener">The change callback.</param>
|
||||
/// <returns>A disposable that removes the listener, or null when none is tracked.</returns>
|
||||
public IDisposable? OnChange(Action<AuditLogOptions, string?> listener)
|
||||
{
|
||||
lock (_listeners)
|
||||
@@ -310,6 +332,8 @@ public class AuditRedactorFailClosedTests
|
||||
return new Noop();
|
||||
}
|
||||
|
||||
/// <summary>Replaces the current options value and notifies every registered listener.</summary>
|
||||
/// <param name="value">The value.</param>
|
||||
public void Set(AuditLogOptions value)
|
||||
{
|
||||
_value = value;
|
||||
@@ -326,6 +350,7 @@ public class AuditRedactorFailClosedTests
|
||||
|
||||
private sealed class Noop : IDisposable
|
||||
{
|
||||
/// <summary>Releases the resources held by the test fixture.</summary>
|
||||
public void Dispose() { }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user