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:
@@ -8,9 +8,10 @@ using ProtoTransitionKind = ZB.MOM.WW.MxGateway.Contracts.Proto.AlarmTransitionK
|
||||
|
||||
namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests;
|
||||
|
||||
/// <summary>Task-12: pure MxGateway alarm-feed proto → NativeAlarmTransition mapping.</summary>
|
||||
/// <summary>Pure MxGateway alarm-feed proto → NativeAlarmTransition mapping.</summary>
|
||||
public class MxGatewayAlarmMapperTests
|
||||
{
|
||||
/// <summary>Verifies that an acknowledge transition is mapped as acknowledged with the operator.</summary>
|
||||
[Fact]
|
||||
public void MapTransition_AckTransition_IsAcknowledgedWithOperator()
|
||||
{
|
||||
@@ -37,6 +38,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal("Tank01", t.SourceObjectReference);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an active, acknowledged condition state maps to active true and acknowledged true.</summary>
|
||||
[Fact]
|
||||
public void MapConditionState_ActiveAcked_To_ActiveTrue_AckTrue()
|
||||
{
|
||||
@@ -46,6 +48,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal(600, c.Severity);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an active, unacknowledged snapshot maps to the snapshot kind.</summary>
|
||||
[Fact]
|
||||
public void MapSnapshot_ActiveUnacked_IsSnapshotKind()
|
||||
{
|
||||
@@ -66,6 +69,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal(1000, t.Condition.Severity);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the source reference is object-relative rather than the full provider reference.</summary>
|
||||
[Fact]
|
||||
public void SourceReference_IsObjectRelative_NotFullProviderReference()
|
||||
{
|
||||
@@ -98,6 +102,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal("CVDAisle_1", snapT.Category);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the source reference falls back to the full reference when the object reference is empty.</summary>
|
||||
[Fact]
|
||||
public void SourceReference_FallsBackToFullReference_WhenObjectReferenceEmpty()
|
||||
{
|
||||
@@ -114,8 +119,9 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal("Galaxy!Area.Obj.Alarm", t.SourceReference);
|
||||
}
|
||||
|
||||
// ── CurrentValue / LimitValue (M2.13 / #27) ──────────────────────────────
|
||||
// ── CurrentValue / LimitValue ──────────────────────────────
|
||||
|
||||
/// <summary>Verifies that the current and limit values of a transition are populated from the proto.</summary>
|
||||
[Fact]
|
||||
public void MapTransition_CurrentAndLimitValue_PopulatedFromProto()
|
||||
{
|
||||
@@ -139,6 +145,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal("90", t.LimitValue);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a transition with no current or limit value yields empty values.</summary>
|
||||
[Fact]
|
||||
public void MapTransition_AbsentCurrentAndLimitValue_YieldsEmpty()
|
||||
{
|
||||
@@ -160,6 +167,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal("", t.LimitValue);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the current and limit values of a snapshot are populated from the proto.</summary>
|
||||
[Fact]
|
||||
public void MapSnapshot_CurrentAndLimitValue_PopulatedFromProto()
|
||||
{
|
||||
@@ -181,6 +189,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal("10", t.LimitValue);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a string MX value produces a string current value.</summary>
|
||||
[Fact]
|
||||
public void MapSnapshot_StringMxValue_ProducesStringCurrentValue()
|
||||
{
|
||||
@@ -206,6 +215,7 @@ public class MxGatewayAlarmMapperTests
|
||||
private static readonly DateTimeOffset GatewayTime =
|
||||
new(2026, 8, 1, 9, 30, 0, TimeSpan.Zero);
|
||||
|
||||
/// <summary>Verifies that an acknowledge transition stamps the observed transition time as the ack time.</summary>
|
||||
[Fact]
|
||||
public void MapTransition_Acknowledge_StampsTheObservedTransitionTimeAsAckTime()
|
||||
{
|
||||
@@ -227,6 +237,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal(t.TransitionTime, t.AckTime);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a raise transition has no ack time.</summary>
|
||||
[Fact]
|
||||
public void MapTransition_Raise_HasNoAckTime()
|
||||
{
|
||||
@@ -243,6 +254,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Null(MxGatewayAlarmMapper.MapTransition(ev).AckTime);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a retrigger transition clears the ack time.</summary>
|
||||
[Fact]
|
||||
public void MapTransition_Retrigger_ClearsTheAckTime()
|
||||
{
|
||||
@@ -260,6 +272,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Null(MxGatewayAlarmMapper.MapTransition(ev).AckTime);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a clear transition has no ack time despite the inactive state mapping to acknowledged.</summary>
|
||||
[Fact]
|
||||
public void MapTransition_Clear_HasNoAckTime_DespiteInactiveMappingToAcked()
|
||||
{
|
||||
@@ -280,6 +293,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Null(t.AckTime); // …but no ack was observed
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an active, acknowledged snapshot restores an ack time from the last transition.</summary>
|
||||
[Fact]
|
||||
public void MapSnapshot_ActiveAcked_RestoresAnAckTimeFromTheLastTransition()
|
||||
{
|
||||
@@ -297,6 +311,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Equal(GatewayTime, MxGatewayAlarmMapper.MapSnapshot(snap).AckTime);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an active, unacknowledged snapshot has no ack time.</summary>
|
||||
[Fact]
|
||||
public void MapSnapshot_ActiveUnacked_HasNoAckTime()
|
||||
{
|
||||
@@ -312,6 +327,7 @@ public class MxGatewayAlarmMapperTests
|
||||
Assert.Null(MxGatewayAlarmMapper.MapSnapshot(snap).AckTime);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the snapshot-complete sentinel carries no ack time.</summary>
|
||||
[Fact]
|
||||
public void SnapshotComplete_Sentinel_CarriesNoAckTime()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user