docs: backfill XML documentation across 756 files
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>, <param>, <typeparam>, and <inheritdoc/> tags to public members surfaced by commentchecker — resolves 5,847 of 5,869 issues (99.6%) across three /fixdocs passes.
This commit is contained in:
@@ -33,6 +33,7 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.IntegrationTests;
|
||||
[Trait("Simulator", "TwinCAT-XAR")]
|
||||
public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
{
|
||||
/// <summary>Verifies that the driver reads a seeded DINT value through real ADS.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_reads_seeded_DINT_through_real_ADS()
|
||||
{
|
||||
@@ -54,6 +55,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
Convert.ToInt32(snapshots[0].Value).ShouldBeGreaterThanOrEqualTo(0);
|
||||
}
|
||||
|
||||
/// <summary>Verifies a write-then-read round trip on a scratch REAL variable.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_write_then_read_round_trip_on_scratch_REAL()
|
||||
{
|
||||
@@ -77,6 +79,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
Convert.ToSingle(readResults[0].Value).ShouldBe(probe, tolerance: 0.001f);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the driver receives native ADS notifications on counter value changes.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_subscribe_receives_native_ADS_notifications_on_counter_changes()
|
||||
{
|
||||
@@ -113,6 +116,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
await drv.UnsubscribeAsync(handle, TestContext.Current.CancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the driver browses the committed symbol hierarchy via real ADS.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_browses_committed_symbol_hierarchy_via_real_ADS()
|
||||
{
|
||||
@@ -153,6 +157,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
symbols.ShouldContain(s => s.InstancePath == "GVL_Enums.currentAxisState");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the driver round-trips array element write and read operations.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_round_trips_array_element_write_and_read()
|
||||
{
|
||||
@@ -179,6 +184,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
Convert.ToSingle(readResults[0].Value).ShouldBe(probe, tolerance: 0.001f);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the driver auto-reconnects after the underlying ADS client is disposed.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_auto_reconnects_after_underlying_client_is_disposed()
|
||||
{
|
||||
@@ -205,6 +211,10 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
second[0].StatusCode.ShouldBe(0u, "driver must transparently reconnect on next read");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the driver reads every primitive type with correct mapping.</summary>
|
||||
/// <param name="symbolPath">The TwinCAT symbol path to read.</param>
|
||||
/// <param name="type">The TwinCAT data type of the symbol.</param>
|
||||
/// <param name="expectedValueInvariant">The expected value in culture-invariant format, or null to skip value assertion.</param>
|
||||
[TwinCATTheory]
|
||||
// vBool's expected value is null — the initial TRUE seed doesn't reliably survive cold
|
||||
// restarts on this deployment, and the point of this theory is round-tripping the type
|
||||
@@ -285,6 +295,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the driver reads bit-indexed BOOL values from word symbols.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_reads_bit_indexed_BOOL_from_word()
|
||||
{
|
||||
@@ -323,6 +334,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
result[1].Value.ShouldBe(false, "bit 4 of 0xBEEF is clear");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the driver reads deeply nested UDT member paths.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_reads_deeply_nested_UDT_path()
|
||||
{
|
||||
@@ -360,6 +372,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
result[1].Value.ShouldBeOfType<bool>();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the driver reports errors for unknown tags, nonexistent symbols, and read-only writes.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_reports_errors_for_unknown_tag_and_nonexistent_symbol_and_readonly_write()
|
||||
{
|
||||
@@ -410,6 +423,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
roWrite[0].StatusCode.ShouldBe(TwinCATStatusMapper.BadNotWritable);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the driver routes reads per device and isolates unreachable peers.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Driver_routes_reads_per_device_and_isolates_unreachable_peers()
|
||||
{
|
||||
@@ -461,6 +475,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
drv.ResolveHost("GhostCounter").ShouldBe(ghostHost);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the probe loop raises a host status transition to Running when the target is reachable.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task Probe_loop_raises_host_status_transition_to_Running_on_reachable_target()
|
||||
{
|
||||
@@ -504,6 +519,7 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
statuses[0].State.ShouldBe(HostState.Running);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that DiscoverAsync renders declared tags and controller browse symbols to the address space builder.</summary>
|
||||
[TwinCATFact]
|
||||
public async Task DiscoverAsync_renders_declared_tags_and_controller_browse_hits_address_space_builder()
|
||||
{
|
||||
@@ -585,33 +601,55 @@ public sealed class TwinCAT3SmokeTests(TwinCATXarFixture sim)
|
||||
/// </summary>
|
||||
internal sealed class RecordingAddressSpaceBuilder : IAddressSpaceBuilder
|
||||
{
|
||||
/// <summary>Gets the list of recorded folder calls.</summary>
|
||||
public List<(string BrowseName, string DisplayName)> Folders { get; } = [];
|
||||
/// <summary>Gets the list of recorded variable calls.</summary>
|
||||
public List<(string BrowseName, DriverAttributeInfo Info)> Variables { get; } = [];
|
||||
|
||||
/// <summary>Gets the browse names of all recorded folders.</summary>
|
||||
public IEnumerable<string> FolderBrowseNames => Folders.Select(f => f.BrowseName);
|
||||
|
||||
/// <summary>Records a folder call and returns this builder for chaining.</summary>
|
||||
/// <param name="browseName">The browse name of the folder.</param>
|
||||
/// <param name="displayName">The display name of the folder.</param>
|
||||
/// <returns>This builder instance for method chaining.</returns>
|
||||
public IAddressSpaceBuilder Folder(string browseName, string displayName)
|
||||
{
|
||||
Folders.Add((browseName, displayName));
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>Records a variable call and returns a handle for it.</summary>
|
||||
/// <param name="browseName">The browse name of the variable.</param>
|
||||
/// <param name="displayName">The display name of the variable.</param>
|
||||
/// <param name="info">The driver attribute information.</param>
|
||||
/// <returns>A variable handle for the recorded variable.</returns>
|
||||
public IVariableHandle Variable(string browseName, string displayName, DriverAttributeInfo info)
|
||||
{
|
||||
Variables.Add((browseName, info));
|
||||
return new Handle(info.FullName);
|
||||
}
|
||||
|
||||
/// <summary>Records a property call (no-op in this test double).</summary>
|
||||
/// <param name="name">The property name.</param>
|
||||
/// <param name="type">The property data type.</param>
|
||||
/// <param name="value">The property value.</param>
|
||||
public void AddProperty(string name, DriverDataType type, object? value) { }
|
||||
|
||||
private sealed class Handle(string fullRef) : IVariableHandle
|
||||
{
|
||||
/// <summary>Gets the full reference of the variable.</summary>
|
||||
public string FullReference => fullRef;
|
||||
/// <summary>Marks the variable as an alarm condition with the specified information.</summary>
|
||||
/// <param name="info">Alarm condition information.</param>
|
||||
/// <returns>An alarm condition sink for handling transitions.</returns>
|
||||
public IAlarmConditionSink MarkAsAlarmCondition(AlarmConditionInfo info) => new NullSink();
|
||||
}
|
||||
|
||||
private sealed class NullSink : IAlarmConditionSink
|
||||
{
|
||||
/// <summary>Handles an alarm condition transition (no-op in this test double).</summary>
|
||||
/// <param name="args">The alarm event arguments.</param>
|
||||
public void OnTransition(AlarmEventArgs args) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,11 +55,16 @@ public sealed class TwinCATXarFixture : IAsyncLifetime
|
||||
/// <summary>TC3 PLC runtime 1. Override via <see cref="PortEnvVar"/>.</summary>
|
||||
public const int DefaultAmsPort = 851;
|
||||
|
||||
/// <summary>Gets the target host address.</summary>
|
||||
public string TargetHost { get; }
|
||||
/// <summary>Gets the target AMS NetId.</summary>
|
||||
public string? TargetNetId { get; }
|
||||
/// <summary>Gets the AMS target port.</summary>
|
||||
public int AmsPort { get; }
|
||||
/// <summary>Gets the reason to skip tests if the fixture is unreachable.</summary>
|
||||
public string? SkipReason { get; }
|
||||
|
||||
/// <summary>Initializes a new instance of the TwinCATXarFixture class.</summary>
|
||||
public TwinCATXarFixture()
|
||||
{
|
||||
TargetHost = Environment.GetEnvironmentVariable(HostEnvVar) ?? "localhost";
|
||||
@@ -82,7 +87,9 @@ public sealed class TwinCATXarFixture : IAsyncLifetime
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValueTask InitializeAsync() => ValueTask.CompletedTask;
|
||||
/// <inheritdoc />
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
/// <summary><c>true</c> when the XAR runtime is reachable + the AmsNetId is set.
|
||||
@@ -116,6 +123,7 @@ public sealed class TwinCATXarCollection : Xunit.ICollectionFixture<TwinCATXarFi
|
||||
/// <summary><c>[Fact]</c>-equivalent gated on <see cref="TwinCATXarFixture.IsRuntimeAvailable"/>.</summary>
|
||||
public sealed class TwinCATFactAttribute : FactAttribute
|
||||
{
|
||||
/// <summary>Initializes a new instance of the TwinCATFactAttribute class.</summary>
|
||||
public TwinCATFactAttribute()
|
||||
{
|
||||
if (!TwinCATXarFixture.IsRuntimeAvailable())
|
||||
@@ -127,6 +135,7 @@ public sealed class TwinCATFactAttribute : FactAttribute
|
||||
/// <summary><c>[Theory]</c>-equivalent with the same gate as <see cref="TwinCATFactAttribute"/>.</summary>
|
||||
public sealed class TwinCATTheoryAttribute : TheoryAttribute
|
||||
{
|
||||
/// <summary>Initializes a new instance of the TwinCATTheoryAttribute class.</summary>
|
||||
public TwinCATTheoryAttribute()
|
||||
{
|
||||
if (!TwinCATXarFixture.IsRuntimeAvailable())
|
||||
|
||||
Reference in New Issue
Block a user