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:
@@ -33,6 +33,8 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
private readonly TestLocalDb _localDb;
|
||||
private readonly string _dbPath;
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>EventLogStorageCapScopeTests</c> class.</summary>
|
||||
/// <param name="output">The output.</param>
|
||||
public EventLogStorageCapScopeTests(ITestOutputHelper output)
|
||||
{
|
||||
_output = output;
|
||||
@@ -44,6 +46,7 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
_localDb.Db);
|
||||
}
|
||||
|
||||
/// <summary>Releases the resources held by this instance.</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_eventLogger.Dispose();
|
||||
@@ -128,6 +131,7 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
return (long)cmd.ExecuteScalar()!;
|
||||
});
|
||||
|
||||
/// <summary>Verifies that the estimated event-log size excludes other tables in the same database file.</summary>
|
||||
[Fact]
|
||||
public void EstimatedSize_ExcludesOtherTablesInTheSameFile()
|
||||
{
|
||||
@@ -154,6 +158,7 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
Assert.Equal(eventsOnly, eventsAfterBallast);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the storage-cap purge does not trim an under-cap event log when other tables in the same file are large.</summary>
|
||||
[Fact]
|
||||
public void PurgeByStorageCap_WithLargeBallastInTheSameFile_DoesNotTrimAnUnderCapEventLog()
|
||||
{
|
||||
@@ -179,6 +184,7 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
Assert.Equal(4000, EventCount());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the storage-cap purge still enforces the cap on events without emptying the table when other tables in the same file are large.</summary>
|
||||
[Fact]
|
||||
public void PurgeByStorageCap_WithLargeBallastInTheSameFile_StillEnforcesTheCapOnEventsAndDoesNotEmptyTheTable()
|
||||
{
|
||||
@@ -217,6 +223,7 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
|
||||
// ── size-model accuracy ──
|
||||
|
||||
/// <summary>Gets the workloads value.</summary>
|
||||
public static TheoryData<string, int, int, double> Workloads => new()
|
||||
{
|
||||
// name, rows, details length (0 = no details column), details on every row
|
||||
@@ -225,6 +232,11 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
{ "wide rows, 2KB details", 3000, 2048, 1.0 },
|
||||
};
|
||||
|
||||
/// <summary>Verifies that the site-events size estimate tracks the real on-disk footprint across workloads.</summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <param name="rows">The rows.</param>
|
||||
/// <param name="detailsLength">The details length.</param>
|
||||
/// <param name="detailsFraction">The details fraction.</param>
|
||||
[Theory]
|
||||
[MemberData(nameof(Workloads))]
|
||||
public void EstimateSiteEventsSize_TracksTheRealFootprint(string name, int rows, int detailsLength, double detailsFraction)
|
||||
@@ -292,13 +304,16 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
long? frozenRowCount)
|
||||
: EventLogPurgeService(eventLogger, options, logger)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
internal override EventLogPurgeService.SiteEventsSizeEstimate EstimateSiteEventsSize() =>
|
||||
estimate ?? base.EstimateSiteEventsSize();
|
||||
|
||||
/// <inheritdoc />
|
||||
internal override long GetSiteEventsRowCount() =>
|
||||
frozenRowCount ?? base.GetSiteEventsRowCount();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the storage-cap purge deletes nothing and logs a warning when the row width cannot be sampled.</summary>
|
||||
[Fact]
|
||||
public void PurgeByStorageCap_WhenRowWidthCannotBeSampled_DeletesNothingAndWarns()
|
||||
{
|
||||
@@ -322,6 +337,7 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
e.Level == LogLevel.Warning && e.Message.Contains("row width could not be sampled", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the storage-cap purge stops rather than emptying the log when the table stops shrinking.</summary>
|
||||
[Fact]
|
||||
public void PurgeByStorageCap_WhenTheTableStopsShrinking_StopsRatherThanEmptyingTheLog()
|
||||
{
|
||||
@@ -351,12 +367,27 @@ public class EventLogStorageCapScopeTests : IDisposable
|
||||
|
||||
private sealed class CapturingLogger : ILogger<EventLogPurgeService>
|
||||
{
|
||||
/// <summary>Gets the entries value.</summary>
|
||||
public List<LogEntry> Entries { get; } = [];
|
||||
|
||||
/// <summary>Returns no scope; the fake does not track scopes.</summary>
|
||||
/// <typeparam name="TState">The type of the scope state.</typeparam>
|
||||
/// <param name="state">The scope state (ignored).</param>
|
||||
/// <returns>Always null.</returns>
|
||||
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => null;
|
||||
|
||||
/// <summary>Reports every log level as enabled.</summary>
|
||||
/// <param name="logLevel">The log level to check.</param>
|
||||
/// <returns>Always true.</returns>
|
||||
public bool IsEnabled(LogLevel logLevel) => true;
|
||||
|
||||
/// <summary>Records the log entry for later assertions.</summary>
|
||||
/// <typeparam name="TState">The type of the log state.</typeparam>
|
||||
/// <param name="logLevel">The severity of the entry.</param>
|
||||
/// <param name="eventId">The event identifier.</param>
|
||||
/// <param name="state">The state object to format.</param>
|
||||
/// <param name="exception">The exception associated with the entry, if any.</param>
|
||||
/// <param name="formatter">Formats the state and exception into the message.</param>
|
||||
public void Log<TState>(
|
||||
LogLevel logLevel, EventId eventId, TState state, Exception? exception,
|
||||
Func<TState, Exception?, string> formatter) =>
|
||||
|
||||
Reference in New Issue
Block a user