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:
@@ -11,7 +11,7 @@ using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Messages;
|
||||
|
||||
/// <summary>
|
||||
/// WP-9 (Phase 8): Message contract compatibility tests.
|
||||
/// Message contract compatibility tests.
|
||||
/// Verifies forward compatibility (unknown fields), backward compatibility (missing optional fields),
|
||||
/// and version skew scenarios for all critical message types.
|
||||
/// </summary>
|
||||
@@ -24,6 +24,7 @@ public class CompatibilityTests
|
||||
|
||||
// ── Forward Compatibility: unknown fields are ignored ──
|
||||
|
||||
/// <summary>Verifies that a deploy-instance command ignores an unknown field when deserialized.</summary>
|
||||
[Fact]
|
||||
public void ForwardCompat_DeployInstanceCommand_UnknownFieldIgnored()
|
||||
{
|
||||
@@ -46,6 +47,7 @@ public class CompatibilityTests
|
||||
Assert.Equal("abc123", msg.RevisionHash);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a site health report ignores an unknown field when deserialized.</summary>
|
||||
[Fact]
|
||||
public void ForwardCompat_SiteHealthReport_UnknownFieldIgnored()
|
||||
{
|
||||
@@ -70,6 +72,7 @@ public class CompatibilityTests
|
||||
Assert.Equal(5, msg.SequenceNumber);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a script call request ignores an unknown field when deserialized.</summary>
|
||||
[Fact]
|
||||
public void ForwardCompat_ScriptCallRequest_UnknownFieldIgnored()
|
||||
{
|
||||
@@ -90,6 +93,7 @@ public class CompatibilityTests
|
||||
Assert.Equal("OnTrigger", msg.ScriptName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an attribute-value-changed message ignores an unknown field when deserialized.</summary>
|
||||
[Fact]
|
||||
public void ForwardCompat_AttributeValueChanged_UnknownFieldIgnored()
|
||||
{
|
||||
@@ -112,6 +116,7 @@ public class CompatibilityTests
|
||||
|
||||
// ── Backward Compatibility: missing optional fields ──
|
||||
|
||||
/// <summary>Verifies that a deployment status response deserializes when the error message is missing.</summary>
|
||||
[Fact]
|
||||
public void BackwardCompat_DeploymentStatusResponse_MissingErrorMessage()
|
||||
{
|
||||
@@ -130,6 +135,7 @@ public class CompatibilityTests
|
||||
Assert.Null(msg.ErrorMessage);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a script call result deserializes when the return value is missing.</summary>
|
||||
[Fact]
|
||||
public void BackwardCompat_ScriptCallResult_MissingReturnValue()
|
||||
{
|
||||
@@ -147,6 +153,7 @@ public class CompatibilityTests
|
||||
Assert.Null(msg.ReturnValue);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a deploy-artifacts command deserializes when the optional lists are missing.</summary>
|
||||
[Fact]
|
||||
public void BackwardCompat_DeployArtifactsCommand_MissingOptionalLists()
|
||||
{
|
||||
@@ -164,6 +171,7 @@ public class CompatibilityTests
|
||||
Assert.Null(msg.ExternalSystems);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an instance lifecycle response deserializes when the error message is missing.</summary>
|
||||
[Fact]
|
||||
public void BackwardCompat_InstanceLifecycleResponse_MissingErrorMessage()
|
||||
{
|
||||
@@ -184,6 +192,7 @@ public class CompatibilityTests
|
||||
|
||||
// ── Version Skew: old message format still deserializable ──
|
||||
|
||||
/// <summary>Verifies that an old-shape deploy command deserializes with default values for newer fields.</summary>
|
||||
[Fact]
|
||||
public void VersionSkew_OldDeployCommand_DeserializesWithDefaults()
|
||||
{
|
||||
@@ -205,6 +214,7 @@ public class CompatibilityTests
|
||||
Assert.Equal("old-hash", msg.RevisionHash);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an old-shape health report deserializes correctly.</summary>
|
||||
[Fact]
|
||||
public void VersionSkew_OldHealthReport_DeserializesCorrectly()
|
||||
{
|
||||
@@ -230,11 +240,12 @@ public class CompatibilityTests
|
||||
|
||||
// ── Round-trip serialization for all key message types ──
|
||||
|
||||
// Communication-016: RoundTrip_ConnectionStateChanged_Succeeds removed
|
||||
// RoundTrip_ConnectionStateChanged_Succeeds removed
|
||||
// alongside the dead ConnectionStateChanged message record. No production
|
||||
// code emits or receives this message — disconnect detection is owned by
|
||||
// the gRPC keepalive and the Ask-timeout path.
|
||||
|
||||
/// <summary>Verifies that an alarm-state-changed message survives a serialization round trip.</summary>
|
||||
[Fact]
|
||||
public void RoundTrip_AlarmStateChanged_Succeeds()
|
||||
{
|
||||
@@ -247,6 +258,7 @@ public class CompatibilityTests
|
||||
Assert.Equal("HighTemp", deserialized.AlarmName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an alarm-state-changed message preserves its acknowledgement time across a round trip.</summary>
|
||||
[Fact]
|
||||
public void RoundTrip_AlarmStateChanged_PreservesAckTime()
|
||||
{
|
||||
@@ -264,6 +276,7 @@ public class CompatibilityTests
|
||||
Assert.Equal(ackedAt, deserialized!.AckTime);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a missing acknowledgement time deserializes as null.</summary>
|
||||
[Fact]
|
||||
public void BackwardCompat_AlarmStateChanged_MissingAckTime_DefaultsToNull()
|
||||
{
|
||||
@@ -285,6 +298,7 @@ public class CompatibilityTests
|
||||
Assert.Null(deserialized!.AckTime);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a missing MES-reportable flag deserializes as false.</summary>
|
||||
[Fact]
|
||||
public void BackwardCompat_AlarmStateChanged_MissingIsMesReportable_DefaultsToFalse()
|
||||
{
|
||||
@@ -308,6 +322,7 @@ public class CompatibilityTests
|
||||
Assert.False(deserialized!.IsMesReportable);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a heartbeat message survives a serialization round trip.</summary>
|
||||
[Fact]
|
||||
public void RoundTrip_HeartbeatMessage_Succeeds()
|
||||
{
|
||||
@@ -320,6 +335,7 @@ public class CompatibilityTests
|
||||
Assert.Equal("node-a", deserialized.NodeHostname);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a disable-instance command survives a serialization round trip.</summary>
|
||||
[Fact]
|
||||
public void RoundTrip_DisableInstanceCommand_Succeeds()
|
||||
{
|
||||
@@ -331,6 +347,7 @@ public class CompatibilityTests
|
||||
Assert.Equal("cmd-1", deserialized!.CommandId);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an enable-instance command survives a serialization round trip.</summary>
|
||||
[Fact]
|
||||
public void RoundTrip_EnableInstanceCommand_Succeeds()
|
||||
{
|
||||
@@ -342,6 +359,7 @@ public class CompatibilityTests
|
||||
Assert.Equal("cmd-2", deserialized!.CommandId);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a delete-instance command survives a serialization round trip.</summary>
|
||||
[Fact]
|
||||
public void RoundTrip_DeleteInstanceCommand_Succeeds()
|
||||
{
|
||||
@@ -355,6 +373,7 @@ public class CompatibilityTests
|
||||
|
||||
// ── Additive-only evolution: new fields added as nullable ──
|
||||
|
||||
/// <summary>Verifies that newly added nullable fields do not break deserialization of older payloads.</summary>
|
||||
[Fact]
|
||||
public void AdditiveEvolution_NewNullableFields_DoNotBreakDeserialization()
|
||||
{
|
||||
@@ -369,6 +388,7 @@ public class CompatibilityTests
|
||||
Assert.Null(msg!.ErrorMessage); // Optional field defaults to null
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an unknown enum value is handled gracefully during deserialization.</summary>
|
||||
[Fact]
|
||||
public void EnumDeserialization_UnknownValue_HandledGracefully()
|
||||
{
|
||||
@@ -381,8 +401,9 @@ public class CompatibilityTests
|
||||
Assert.Equal((DeploymentStatus)99, msg!.Status);
|
||||
}
|
||||
|
||||
// ── DeploymentManager-006: query-the-site-before-redeploy contracts ──
|
||||
// ── query-the-site-before-redeploy contracts ──
|
||||
|
||||
/// <summary>Verifies that a deployment-state query request survives a serialization round trip.</summary>
|
||||
[Fact]
|
||||
public void RoundTrip_DeploymentStateQueryRequest_Succeeds()
|
||||
{
|
||||
@@ -395,6 +416,7 @@ public class CompatibilityTests
|
||||
Assert.Equal("inst-1", deserialized.InstanceUniqueName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a deployed deployment-state query response survives a serialization round trip.</summary>
|
||||
[Fact]
|
||||
public void RoundTrip_DeploymentStateQueryResponse_Deployed_Succeeds()
|
||||
{
|
||||
@@ -409,6 +431,7 @@ public class CompatibilityTests
|
||||
Assert.Equal("sha256:abc", deserialized.AppliedRevisionHash);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a not-deployed deployment-state query response keeps its null applied state across a round trip.</summary>
|
||||
[Fact]
|
||||
public void RoundTrip_DeploymentStateQueryResponse_NotDeployed_NullApplied()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user