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:
@@ -7,6 +7,7 @@ public class DiffServiceTests
|
||||
{
|
||||
private readonly DiffService _sut = new();
|
||||
|
||||
/// <summary>Verifies that a null old configuration reports everything as added.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_NullOldConfig_AllAdded()
|
||||
{
|
||||
@@ -37,6 +38,7 @@ public class DiffServiceTests
|
||||
Assert.Single(diff.ScriptChanges);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that identical configurations produce no changes.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_IdenticalConfigs_NoChanges()
|
||||
{
|
||||
@@ -54,6 +56,7 @@ public class DiffServiceTests
|
||||
Assert.Empty(diff.AttributeChanges);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a removed attribute is detected as removed.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_AttributeRemoved_DetectedAsRemoved()
|
||||
{
|
||||
@@ -80,6 +83,7 @@ public class DiffServiceTests
|
||||
Assert.Equal("Removed", diff.AttributeChanges[0].CanonicalName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a changed attribute is detected as changed.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_AttributeChanged_DetectedAsChanged()
|
||||
{
|
||||
@@ -103,6 +107,7 @@ public class DiffServiceTests
|
||||
Assert.Equal("50", diff.AttributeChanges[0].NewValue?.Value);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the revision hashes are included in the diff.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_RevisionHashes_Included()
|
||||
{
|
||||
@@ -113,6 +118,7 @@ public class DiffServiceTests
|
||||
Assert.Equal("sha256:new", diff.NewRevisionHash);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a script code change is detected.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_ScriptCodeChange_Detected()
|
||||
{
|
||||
@@ -134,10 +140,11 @@ public class DiffServiceTests
|
||||
Assert.Equal(DiffChangeType.Changed, diff.ScriptChanges[0].ChangeType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an attribute description change is detected as changed.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_AttributeDescriptionChange_DetectedAsChanged()
|
||||
{
|
||||
// TemplateEngine-017: AttributesEqual must compare Description.
|
||||
// AttributesEqual must compare Description.
|
||||
var oldConfig = new FlattenedConfiguration
|
||||
{
|
||||
InstanceUniqueName = "Instance1",
|
||||
@@ -162,10 +169,11 @@ public class DiffServiceTests
|
||||
Assert.Equal(DiffChangeType.Changed, diff.AttributeChanges[0].ChangeType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an attribute element data type change is detected as changed.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_AttributeElementDataTypeChange_DetectedAsChanged()
|
||||
{
|
||||
// #290: ElementDataType is part of the revision hash, so AttributesEqual
|
||||
// ElementDataType is part of the revision hash, so AttributesEqual
|
||||
// must also compare it — a List element-type change (Int32 → Double) with
|
||||
// identical JSON-encoded values must surface as a Changed attribute,
|
||||
// keeping the structured diff in parity with the staleness hash.
|
||||
@@ -193,10 +201,11 @@ public class DiffServiceTests
|
||||
Assert.Equal(DiffChangeType.Changed, diff.AttributeChanges[0].ChangeType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an alarm description change is detected as changed.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_AlarmDescriptionChange_DetectedAsChanged()
|
||||
{
|
||||
// TemplateEngine-017: AlarmsEqual must compare Description.
|
||||
// AlarmsEqual must compare Description.
|
||||
var oldConfig = new FlattenedConfiguration
|
||||
{
|
||||
InstanceUniqueName = "Instance1",
|
||||
@@ -221,10 +230,11 @@ public class DiffServiceTests
|
||||
Assert.Equal(DiffChangeType.Changed, diff.AlarmChanges[0].ChangeType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a native alarm source reference change is detected as changed.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_NativeAlarmSourceReferenceChange_DetectedAsChanged()
|
||||
{
|
||||
// PLAN-05 Task 12: native alarm source edits must surface in the diff so
|
||||
// Native alarm source edits must surface in the diff so
|
||||
// the Deployments diff view is not blind to native-alarm binding changes.
|
||||
var oldConfig = new FlattenedConfiguration
|
||||
{
|
||||
@@ -251,6 +261,7 @@ public class DiffServiceTests
|
||||
Assert.Equal("PumpAlarms", diff.NativeAlarmSourceChanges[0].CanonicalName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an added native alarm source is detected as added.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_NativeAlarmSourceAdded_DetectedAsAdded()
|
||||
{
|
||||
@@ -271,6 +282,7 @@ public class DiffServiceTests
|
||||
Assert.Equal(DiffChangeType.Added, diff.NativeAlarmSourceChanges[0].ChangeType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a removed native alarm source is detected as removed.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_NativeAlarmSourceRemoved_DetectedAsRemoved()
|
||||
{
|
||||
@@ -291,6 +303,7 @@ public class DiffServiceTests
|
||||
Assert.Equal(DiffChangeType.Removed, diff.NativeAlarmSourceChanges[0].ChangeType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a native alarm source lock change is detected as changed.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_NativeAlarmSourceLockChange_DetectedAsChanged()
|
||||
{
|
||||
@@ -317,6 +330,7 @@ public class DiffServiceTests
|
||||
Assert.Equal(DiffChangeType.Changed, diff.NativeAlarmSourceChanges[0].ChangeType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an unchanged native alarm source produces no diff.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_NativeAlarmSourceUnchanged_NoDiff()
|
||||
{
|
||||
@@ -329,12 +343,12 @@ public class DiffServiceTests
|
||||
Assert.Empty(diff.NativeAlarmSourceChanges);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that identical connection configurations compare as equal.</summary>
|
||||
[Fact]
|
||||
public void ConnectionsEqual_IdenticalConfigs_ReturnsTrue()
|
||||
{
|
||||
// TemplateEngine-017: ConnectionsEqual is the comparator callers use
|
||||
// to detect connection-endpoint drift (the diff-view extension that
|
||||
// surfaces this in the UI is tracked under TemplateEngine-018).
|
||||
// ConnectionsEqual is the comparator callers use
|
||||
// to detect connection-endpoint drift.
|
||||
var a = new ConnectionConfig
|
||||
{
|
||||
Protocol = "OpcUa",
|
||||
@@ -347,10 +361,11 @@ public class DiffServiceTests
|
||||
Assert.True(DiffService.ConnectionsEqual(a, b));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an endpoint edit makes the connection configurations compare as unequal.</summary>
|
||||
[Fact]
|
||||
public void ConnectionsEqual_EndpointEdit_ReturnsFalse()
|
||||
{
|
||||
// TemplateEngine-017: primary endpoint JSON edit must surface as a
|
||||
// A primary endpoint JSON edit must surface as a
|
||||
// change. Without this, deployment redeploys ship a different
|
||||
// ConnectionConfig with no visible drift signal.
|
||||
var a = new ConnectionConfig
|
||||
@@ -364,6 +379,7 @@ public class DiffServiceTests
|
||||
Assert.False(DiffService.ConnectionsEqual(a, b));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a backup configuration edit makes the connection configurations compare as unequal.</summary>
|
||||
[Fact]
|
||||
public void ConnectionsEqual_BackupConfigurationEdit_ReturnsFalse()
|
||||
{
|
||||
@@ -373,6 +389,7 @@ public class DiffServiceTests
|
||||
Assert.False(DiffService.ConnectionsEqual(a, b));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a failover retry count edit makes the connection configurations compare as unequal.</summary>
|
||||
[Fact]
|
||||
public void ConnectionsEqual_FailoverRetryCountEdit_ReturnsFalse()
|
||||
{
|
||||
@@ -382,6 +399,7 @@ public class DiffServiceTests
|
||||
Assert.False(DiffService.ConnectionsEqual(a, b));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a protocol edit makes the connection configurations compare as unequal.</summary>
|
||||
[Fact]
|
||||
public void ConnectionsEqual_ProtocolEdit_ReturnsFalse()
|
||||
{
|
||||
@@ -391,14 +409,15 @@ public class DiffServiceTests
|
||||
Assert.False(DiffService.ConnectionsEqual(a, b));
|
||||
}
|
||||
|
||||
// ── TemplateEngine-018: ComputeConnectionsDiff produces Added/Removed/Changed entries ──
|
||||
// ── ComputeConnectionsDiff produces Added/Removed/Changed entries ──
|
||||
|
||||
/// <summary>Verifies that a newly added binding is reported as added in the connections diff.</summary>
|
||||
[Fact]
|
||||
public void ComputeConnectionsDiff_NewBindingAdded_ReportedAsAdded()
|
||||
{
|
||||
// First-time binding (or instance gains its first data-sourced
|
||||
// attribute) — old config has no Connections map, new config does.
|
||||
// The pre-018 diff shape silently dropped this so operators saw
|
||||
// The earlier diff shape silently dropped this so operators saw
|
||||
// "no changes" when the deployment package was structurally larger.
|
||||
var oldConfig = new FlattenedConfiguration { InstanceUniqueName = "Instance1" };
|
||||
var newConfig = new FlattenedConfiguration
|
||||
@@ -425,6 +444,7 @@ public class DiffServiceTests
|
||||
Assert.Equal("OpcUa", diff[0].NewValue!.Protocol);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a null old configuration reports all connections as added.</summary>
|
||||
[Fact]
|
||||
public void ComputeConnectionsDiff_NullOldConfig_AllReportedAsAdded()
|
||||
{
|
||||
@@ -455,6 +475,7 @@ public class DiffServiceTests
|
||||
Assert.Equal("OpcUa", diff[0].NewValue!.Protocol);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a cleared binding is reported as removed in the connections diff.</summary>
|
||||
[Fact]
|
||||
public void ComputeConnectionsDiff_BindingCleared_ReportedAsRemoved()
|
||||
{
|
||||
@@ -479,6 +500,7 @@ public class DiffServiceTests
|
||||
Assert.Null(diff[0].NewValue);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an endpoint edit is reported as changed in the connections diff.</summary>
|
||||
[Fact]
|
||||
public void ComputeConnectionsDiff_EndpointEdit_ReportedAsChanged()
|
||||
{
|
||||
@@ -521,6 +543,7 @@ public class DiffServiceTests
|
||||
Assert.Contains("host-b", diff[0].NewValue!.ConfigurationJson);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that identical connections produce no diff entries.</summary>
|
||||
[Fact]
|
||||
public void ComputeConnectionsDiff_IdenticalConnections_NoEntries()
|
||||
{
|
||||
@@ -539,10 +562,11 @@ public class DiffServiceTests
|
||||
Assert.Empty(diff);
|
||||
}
|
||||
|
||||
// ── TemplateEngine-018: ComputeDiff wires ComputeConnectionsDiff into the
|
||||
// ── ComputeDiff wires ComputeConnectionsDiff into the
|
||||
// public ConfigurationDiff.ConnectionChanges slot so standalone connection
|
||||
// protocol/endpoint/failover drift surfaces in the deployment diff (#10). ──
|
||||
// protocol/endpoint/failover drift surfaces in the deployment diff. ──
|
||||
|
||||
/// <summary>Verifies that protocol, endpoint and failover changes populate the connection changes of the diff.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_ConnectionProtocolAndEndpointAndFailoverChange_PopulatesConnectionChanges()
|
||||
{
|
||||
@@ -591,6 +615,7 @@ public class DiffServiceTests
|
||||
Assert.Equal(5, entry.NewValue!.FailoverRetryCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a diff that differs only in its connections reports changes.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_OnlyConnectionDiffers_HasChangesIsTrue()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user