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
-3
@@ -23,7 +23,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc;
|
||||
/// back as null-or-empty rather than as a zero-valued stand-in. The minimal cases are
|
||||
/// the ones that matter: a per-field unit test happily passes while a whole optional
|
||||
/// branch is silently never written, which is exactly the class of bug the round-trip
|
||||
/// guard in PLAN-05 T8 caught five times over.
|
||||
/// guard caught five times over.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// When a round-trip here fails, the mapper is wrong — not the test.
|
||||
@@ -38,6 +38,7 @@ public class CentralControlDtoMapperTests
|
||||
// NotificationSubmit / Ack
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/// <summary>Verifies that a fully populated notification submission round-trips with every field preserved.</summary>
|
||||
[Fact]
|
||||
public void NotificationSubmit_RoundTrip_FullyPopulated_PreservesEveryField()
|
||||
{
|
||||
@@ -60,6 +61,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(original, roundTripped);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a notification submission with all optional fields null keeps them null.</summary>
|
||||
[Fact]
|
||||
public void NotificationSubmit_RoundTrip_AllOptionalsNull_StayNull()
|
||||
{
|
||||
@@ -86,6 +88,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Null(roundTripped.SourceNode);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a non-UTC offset timestamp is normalized to the same instant.</summary>
|
||||
[Fact]
|
||||
public void NotificationSubmit_NonUtcOffset_NormalizesToTheSameInstant()
|
||||
{
|
||||
@@ -103,6 +106,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(TimeSpan.Zero, roundTripped.SiteEnqueuedAt.Offset);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that accepted and rejected submission acknowledgements both round-trip.</summary>
|
||||
[Fact]
|
||||
public void NotificationSubmitAck_RoundTrip_Accepted_And_Rejected()
|
||||
{
|
||||
@@ -118,6 +122,7 @@ public class CentralControlDtoMapperTests
|
||||
// NotificationStatusQuery / Response
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/// <summary>Verifies that a notification status query round-trips with every field preserved.</summary>
|
||||
[Fact]
|
||||
public void NotificationStatusQuery_RoundTrip_PreservesEveryField()
|
||||
{
|
||||
@@ -126,6 +131,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(original, CentralControlDtoMapper.FromDto(Wire(CentralControlDtoMapper.ToDto(original))));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a fully populated status response round-trips with every field preserved.</summary>
|
||||
[Fact]
|
||||
public void NotificationStatusResponse_RoundTrip_FullyPopulated_PreservesEveryField()
|
||||
{
|
||||
@@ -140,6 +146,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(original, CentralControlDtoMapper.FromDto(Wire(CentralControlDtoMapper.ToDto(original))));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a not-found status response leaves its optional fields null.</summary>
|
||||
[Fact]
|
||||
public void NotificationStatusResponse_RoundTrip_NotFound_LeavesOptionalsNull()
|
||||
{
|
||||
@@ -162,6 +169,7 @@ public class CentralControlDtoMapperTests
|
||||
// Audit ingest envelopes (rows delegate to AuditEventDtoMapper / SiteCallDtoMapper)
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/// <summary>Verifies that an audit-ingest command preserves the order and content of its rows.</summary>
|
||||
[Fact]
|
||||
public void IngestAuditEventsCommand_RoundTrip_PreservesOrderAndRows()
|
||||
{
|
||||
@@ -178,6 +186,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal("OnTrigger", roundTripped.Events[1].AsRow().SourceScript);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an empty audit-ingest batch stays empty.</summary>
|
||||
[Fact]
|
||||
public void IngestAuditEventsCommand_RoundTrip_EmptyBatch_StaysEmpty()
|
||||
{
|
||||
@@ -187,6 +196,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Empty(roundTripped.Events);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a cached-telemetry command preserves both the audit and operational halves of each packet.</summary>
|
||||
[Fact]
|
||||
public void IngestCachedTelemetryCommand_RoundTrip_PreservesBothHalvesOfEachPacket()
|
||||
{
|
||||
@@ -204,6 +214,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(siteCall with { IngestedAtUtc = default }, entry.SiteCall with { IngestedAtUtc = default });
|
||||
}
|
||||
|
||||
/// <summary>Verifies that nullable site-call fields in cached telemetry stay null.</summary>
|
||||
[Fact]
|
||||
public void IngestCachedTelemetryCommand_RoundTrip_NullableSiteCallFields_StayNull()
|
||||
{
|
||||
@@ -226,6 +237,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Null(entry.SiteCall.TerminalAtUtc);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an empty cached-telemetry batch stays empty.</summary>
|
||||
[Fact]
|
||||
public void IngestCachedTelemetryCommand_RoundTrip_EmptyBatch_StaysEmpty()
|
||||
{
|
||||
@@ -235,6 +247,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Empty(roundTripped.Entries);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an ingest acknowledgement preserves its ids and their order.</summary>
|
||||
[Fact]
|
||||
public void IngestAck_RoundTrip_PreservesIdsAndOrder()
|
||||
{
|
||||
@@ -246,6 +259,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(ids, roundTripped);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an ingest acknowledgement with nothing accepted stays empty.</summary>
|
||||
[Fact]
|
||||
public void IngestAck_RoundTrip_NothingAccepted_StaysEmpty()
|
||||
{
|
||||
@@ -259,6 +273,7 @@ public class CentralControlDtoMapperTests
|
||||
// Startup reconciliation
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/// <summary>Verifies that a reconcile request preserves its inventory map.</summary>
|
||||
[Fact]
|
||||
public void ReconcileSiteRequest_RoundTrip_PreservesInventoryMap()
|
||||
{
|
||||
@@ -280,6 +295,7 @@ public class CentralControlDtoMapperTests
|
||||
roundTripped.LocalNameToRevisionHash.OrderBy(kv => kv.Key));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a reconcile request with an empty inventory stays empty.</summary>
|
||||
[Fact]
|
||||
public void ReconcileSiteRequest_RoundTrip_EmptyInventory_StaysEmpty()
|
||||
{
|
||||
@@ -291,6 +307,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Empty(roundTripped.LocalNameToRevisionHash);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a reconcile response preserves its gap, orphans and URL.</summary>
|
||||
[Fact]
|
||||
public void ReconcileSiteResponse_RoundTrip_PreservesGapOrphansAndUrl()
|
||||
{
|
||||
@@ -310,6 +327,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(original.CentralFetchBaseUrl, roundTripped.CentralFetchBaseUrl);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a reconcile response with no gap stays empty.</summary>
|
||||
[Fact]
|
||||
public void ReconcileSiteResponse_RoundTrip_NoGap_StaysEmpty()
|
||||
{
|
||||
@@ -324,6 +342,7 @@ public class CentralControlDtoMapperTests
|
||||
// Site health
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/// <summary>Verifies that a fully populated site health report round-trips with every field preserved.</summary>
|
||||
[Fact]
|
||||
public void SiteHealthReport_RoundTrip_FullyPopulated_PreservesEveryField()
|
||||
{
|
||||
@@ -334,6 +353,7 @@ public class CentralControlDtoMapperTests
|
||||
AssertHealthReportsEqual(original, roundTripped);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a minimal site health report leaves every optional field null or empty.</summary>
|
||||
[Fact]
|
||||
public void SiteHealthReport_RoundTrip_MinimalReport_LeavesEveryOptionalNullOrEmpty()
|
||||
{
|
||||
@@ -372,6 +392,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Null(roundTripped.SecretMirrorStatuses);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that empty nullable collections in a health report stay empty rather than becoming null.</summary>
|
||||
[Fact]
|
||||
public void SiteHealthReport_RoundTrip_EmptyNullableCollections_StayEmptyNotNull()
|
||||
{
|
||||
@@ -401,6 +422,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Empty(roundTripped.ClusterNodes);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that false and zero gauge values in a health report stay false and zero.</summary>
|
||||
[Fact]
|
||||
public void SiteHealthReport_RoundTrip_FalseAndZeroGauges_StayFalseAndZero()
|
||||
{
|
||||
@@ -427,6 +449,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(0d, roundTripped.ScriptOldestBusyAgeSeconds);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a backlog report with an empty queue keeps a null oldest-pending value.</summary>
|
||||
[Fact]
|
||||
public void SiteHealthReport_RoundTrip_BacklogWithEmptyQueue_KeepsNullOldestPending()
|
||||
{
|
||||
@@ -440,6 +463,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(new SiteAuditBacklogSnapshot(0, null, 4096), roundTripped.SiteAuditBacklog);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that accepted and rejected health report acknowledgements both round-trip.</summary>
|
||||
[Fact]
|
||||
public void SiteHealthReportAck_RoundTrip_Accepted_And_Rejected()
|
||||
{
|
||||
@@ -455,6 +479,8 @@ public class CentralControlDtoMapperTests
|
||||
// Heartbeat + ConnectionHealth enum
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/// <summary>Verifies that a heartbeat message round-trips with every field preserved.</summary>
|
||||
/// <param name="isActive">Whether the heartbeat reports an active node.</param>
|
||||
[Theory]
|
||||
[InlineData(true)]
|
||||
[InlineData(false)]
|
||||
@@ -465,6 +491,8 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(original, CentralControlDtoMapper.FromDto(Wire(CentralControlDtoMapper.ToDto(original))));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that every connection health value survives a round trip.</summary>
|
||||
/// <param name="health">The connection health value under test.</param>
|
||||
[Theory]
|
||||
[InlineData(ConnectionHealth.Connected)]
|
||||
[InlineData(ConnectionHealth.Disconnected)]
|
||||
@@ -475,6 +503,7 @@ public class CentralControlDtoMapperTests
|
||||
Assert.Equal(health, CentralControlDtoMapper.FromDto(CentralControlDtoMapper.ToDto(health)));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an unspecified wire value decodes to the error-not-connected health state.</summary>
|
||||
[Fact]
|
||||
public void ConnectionHealth_Unspecified_DecodesToErrorNotConnected()
|
||||
{
|
||||
@@ -485,6 +514,7 @@ public class CentralControlDtoMapperTests
|
||||
CentralControlDtoMapper.FromDto(ConnectionHealthEnum.ConnectionHealthUnspecified));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that every connection health enum member has a wire mapping.</summary>
|
||||
[Fact]
|
||||
public void ConnectionHealth_EveryEnumMemberIsMapped()
|
||||
{
|
||||
@@ -559,12 +589,12 @@ public class CentralControlDtoMapperTests
|
||||
LocalDbReplicationConnected = true,
|
||||
LocalDbOplogBacklog = 250L,
|
||||
StartupReconcilerActive = true,
|
||||
// arch-review 2026-08-19 P8-1: these three never crossed the wire at all
|
||||
// These three never crossed the wire at all
|
||||
// (mapper omitted them entirely, always reading back as 0) until this fix.
|
||||
DetachedScriptThreads = 2,
|
||||
ScriptRunShedCount = 13,
|
||||
SiteStreamAlarmDropCount = 41L,
|
||||
// Review finding M1: every node's secret mirror status, standby included.
|
||||
// Every node's secret mirror status, standby included.
|
||||
SecretMirrorStatuses =
|
||||
[
|
||||
new SecretMirrorNodeStatus("node-a", SampleInstant, []),
|
||||
|
||||
Reference in New Issue
Block a user