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:
Joseph Doherty
2026-10-07 15:05:49 -04:00
parent 0ffd4bdbea
commit 513fa1aa16
998 changed files with 17896 additions and 2395 deletions
@@ -16,6 +16,7 @@ public class KpiSeriesBucketerTests
// Guard / invalid-argument contracts
// -----------------------------------------------------------------------
/// <summary>Verifies that a maximum point count below two throws an ArgumentOutOfRangeException.</summary>
[Fact]
public void Bucket_MaxPointsLessThan2_ThrowsArgumentOutOfRangeException()
{
@@ -25,6 +26,7 @@ public class KpiSeriesBucketerTests
KpiSeriesBucketer.Bucket(raw, T(0), T(60), maxPoints: 1));
}
/// <summary>Verifies that a maximum point count of zero throws an ArgumentOutOfRangeException.</summary>
[Fact]
public void Bucket_MaxPointsZero_ThrowsArgumentOutOfRangeException()
{
@@ -34,6 +36,7 @@ public class KpiSeriesBucketerTests
KpiSeriesBucketer.Bucket(raw, T(0), T(60), maxPoints: 0));
}
/// <summary>Verifies that a window whose end equals its start throws an ArgumentOutOfRangeException.</summary>
[Fact]
public void Bucket_ToUtcEqualFromUtc_ThrowsArgumentOutOfRangeException()
{
@@ -43,6 +46,7 @@ public class KpiSeriesBucketerTests
KpiSeriesBucketer.Bucket(raw, T(30), T(30), maxPoints: 5));
}
/// <summary>Verifies that a window that ends before it starts throws an ArgumentOutOfRangeException.</summary>
[Fact]
public void Bucket_ToUtcBeforeFromUtc_ThrowsArgumentOutOfRangeException()
{
@@ -56,6 +60,7 @@ public class KpiSeriesBucketerTests
// Empty / null raw series
// -----------------------------------------------------------------------
/// <summary>Verifies that a null raw series returns an empty list.</summary>
[Fact]
public void Bucket_NullRaw_ReturnsEmptyList()
{
@@ -64,6 +69,7 @@ public class KpiSeriesBucketerTests
Assert.Empty(result);
}
/// <summary>Verifies that an empty raw series returns an empty list.</summary>
[Fact]
public void Bucket_EmptyRaw_ReturnsEmptyList()
{
@@ -77,6 +83,7 @@ public class KpiSeriesBucketerTests
// raw.Count <= maxPoints → returned unchanged (same reference)
// -----------------------------------------------------------------------
/// <summary>Verifies that a raw series with exactly the maximum number of points is returned as the same reference.</summary>
[Fact]
public void Bucket_RawCountEqualsMaxPoints_ReturnsSameReference()
{
@@ -92,6 +99,7 @@ public class KpiSeriesBucketerTests
Assert.Same(raw, result);
}
/// <summary>Verifies that a raw series with fewer points than the maximum is returned as the same reference.</summary>
[Fact]
public void Bucket_RawCountLessThanMaxPoints_ReturnsSameReference()
{
@@ -106,6 +114,7 @@ public class KpiSeriesBucketerTests
Assert.Same(raw, result);
}
/// <summary>Verifies that a single-point series is returned as the same reference.</summary>
[Fact]
public void Bucket_SinglePoint_ReturnsSameReference()
{
@@ -120,6 +129,7 @@ public class KpiSeriesBucketerTests
// Downsampling: correct bucket count and last-value selection
// -----------------------------------------------------------------------
/// <summary>Verifies that a series with more points than the maximum is reduced to the maximum number of buckets.</summary>
[Fact]
public void Bucket_MorePointsThanMaxPoints_ReducesToMaxPointsBuckets()
{
@@ -140,6 +150,7 @@ public class KpiSeriesBucketerTests
Assert.Equal(30.0, result[2].Value);
}
/// <summary>Verifies that when several points fall in the same bucket the last value wins.</summary>
[Fact]
public void Bucket_MultiplePointsInSameBucket_LastValueWins()
{
@@ -160,6 +171,7 @@ public class KpiSeriesBucketerTests
Assert.Equal(5.0, result[1].Value); // only point in bucket 1
}
/// <summary>Verifies that each output point carries the bucket start rather than the raw point timestamp.</summary>
[Fact]
public void Bucket_BucketStartUtc_IsSetToBucketStartNotRawPointTimestamp()
{
@@ -187,10 +199,11 @@ public class KpiSeriesBucketerTests
// Unsorted input: last-in-iteration wins within a bucket (NOT largest timestamp)
// -----------------------------------------------------------------------
/// <summary>Verifies that for unsorted input the last point in iteration order is selected, not the point with the largest timestamp.</summary>
[Fact]
public void Bucket_UnsortedInput_SelectsLastInIterationNotLargestTimestamp()
{
// KpiHistory-006 regression: pins the documented contract that for unsorted input the
// Regression: pins the documented contract that for unsorted input the
// bucketer selects the LAST point in iteration order within a bucket — it does NOT pick
// the largest-timestamp point. Both points below fall in bucket 0 ([0, 30)); the later
// one in iteration order, T(5)=value 1.0, arrives second, so it overwrites T(20)=value
@@ -216,10 +229,11 @@ public class KpiSeriesBucketerTests
// Short series (raw.Count <= maxPoints): returned unchanged → raw capture timestamps
// -----------------------------------------------------------------------
/// <summary>Verifies that a short series keeps its raw capture timestamps instead of bucket boundaries.</summary>
[Fact]
public void Bucket_ShortSeries_ReturnsRawCaptureTimestampsNotBucketBoundaries()
{
// KpiHistory-005/003 regression: the short-series early-return path returns the input
// Regression: the short-series early-return path returns the input
// unchanged, so each output point's BucketStartUtc is the RAW capture timestamp — NOT a
// bucket-boundary timestamp (which is what the downsample path emits, asserted by
// Bucket_BucketStartUtc_IsSetToBucketStartNotRawPointTimestamp). This pins the
@@ -243,6 +257,7 @@ public class KpiSeriesBucketerTests
// Right-edge: point exactly at toUtc lands in the last bucket
// -----------------------------------------------------------------------
/// <summary>Verifies that a point exactly at the window end lands in the last bucket.</summary>
[Fact]
public void Bucket_PointAtToUtc_LandsInLastBucket()
{
@@ -264,6 +279,7 @@ public class KpiSeriesBucketerTests
Assert.Equal(7.0, result[1].Value);
}
/// <summary>Verifies that in a three-bucket window a point exactly at the window end lands in the last bucket.</summary>
[Fact]
public void Bucket_ThreeBucketWindow_PointAtToUtc_LandsInLastBucket()
{
@@ -291,6 +307,7 @@ public class KpiSeriesBucketerTests
// Empty buckets omitted — no gap-filling
// -----------------------------------------------------------------------
/// <summary>Verifies that empty buckets caused by a gap in the raw data are omitted.</summary>
[Fact]
public void Bucket_GapInRaw_EmptyBucketsOmitted()
{
@@ -329,6 +346,7 @@ public class KpiSeriesBucketerTests
// Points outside [fromUtc, toUtc] are ignored
// -----------------------------------------------------------------------
/// <summary>Verifies that points outside the window are ignored.</summary>
[Fact]
public void Bucket_PointsOutsideWindow_AreIgnored()
{
@@ -353,6 +371,7 @@ public class KpiSeriesBucketerTests
// Two-point minimum — maxPoints == 2 works correctly
// -----------------------------------------------------------------------
/// <summary>Verifies that a maximum of exactly two points produces at most two buckets.</summary>
[Fact]
public void Bucket_MaxPointsExactly2_ProducesAtMostTwoBuckets()
{
@@ -374,6 +393,7 @@ public class KpiSeriesBucketerTests
// Per-metric reduction: Rate series sum per bucket (arch-review 04 round 2, R3)
// -----------------------------------------------------------------------
/// <summary>Verifies that a rate series sums the values in each bucket instead of taking the last value.</summary>
[Fact]
public void Bucket_RateSeries_SumsPerBucket_InsteadOfLastValue()
{
@@ -397,6 +417,7 @@ public class KpiSeriesBucketerTests
Assert.Equal(30.0, result[1].Value);
}
/// <summary>Verifies that a short rate series still sums clustered points.</summary>
[Fact]
public void Bucket_RateSeries_ShortSeries_StillSumsClusteredPoints()
{
@@ -418,6 +439,7 @@ public class KpiSeriesBucketerTests
Assert.Equal(10.0, result[1].Value); // T(30) alone
}
/// <summary>Verifies that bucketing a rate series preserves the series total.</summary>
[Fact]
public void Bucket_RateSeries_PreservesSeriesTotal()
{
@@ -436,6 +458,7 @@ public class KpiSeriesBucketerTests
Assert.Equal(inWindowTotal, result.Sum(p => p.Value));
}
/// <summary>Verifies that the default aggregation is gauge and its behavior is unchanged.</summary>
[Fact]
public void Bucket_DefaultAggregation_IsGauge_AndBehaviorUnchanged()
{