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:
@@ -6,6 +6,9 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.Modbus.Tests;
|
||||
[Trait("Category", "Unit")]
|
||||
public sealed class DirectLogicAddressTests
|
||||
{
|
||||
/// <summary>Tests that octal V-prefixed addresses are correctly converted to PDU values.</summary>
|
||||
/// <param name="v">V-prefixed octal address string.</param>
|
||||
/// <param name="expected">Expected PDU address value.</param>
|
||||
[Theory]
|
||||
[InlineData("V0", (ushort)0x0000)]
|
||||
[InlineData("V1", (ushort)0x0001)]
|
||||
@@ -18,6 +21,9 @@ public sealed class DirectLogicAddressTests
|
||||
public void UserVMemoryToPdu_converts_octal_V_prefix(string v, ushort expected)
|
||||
=> DirectLogicAddress.UserVMemoryToPdu(v).ShouldBe(expected);
|
||||
|
||||
/// <summary>Tests that user memory addresses accept bare, prefixed, and padded forms.</summary>
|
||||
/// <param name="v">Address string in various formats.</param>
|
||||
/// <param name="expected">Expected PDU address value.</param>
|
||||
[Theory]
|
||||
[InlineData("0", (ushort)0)]
|
||||
[InlineData("2000", (ushort)0x0400)]
|
||||
@@ -26,6 +32,8 @@ public sealed class DirectLogicAddressTests
|
||||
public void UserVMemoryToPdu_accepts_bare_or_prefixed_or_padded(string v, ushort expected)
|
||||
=> DirectLogicAddress.UserVMemoryToPdu(v).ShouldBe(expected);
|
||||
|
||||
/// <summary>Tests that non-octal digits in user memory addresses are rejected.</summary>
|
||||
/// <param name="v">Address string with invalid octal digits.</param>
|
||||
[Theory]
|
||||
[InlineData("V8")] // 8 is not a valid octal digit
|
||||
[InlineData("V19")]
|
||||
@@ -36,6 +44,8 @@ public sealed class DirectLogicAddressTests
|
||||
.Message.ShouldContain("octal");
|
||||
}
|
||||
|
||||
/// <summary>Tests that empty input for user memory addresses is rejected.</summary>
|
||||
/// <param name="v">Empty or whitespace-only address string.</param>
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
@@ -44,6 +54,7 @@ public sealed class DirectLogicAddressTests
|
||||
public void UserVMemoryToPdu_rejects_empty_input(string? v)
|
||||
=> Should.Throw<ArgumentException>(() => DirectLogicAddress.UserVMemoryToPdu(v!));
|
||||
|
||||
/// <summary>Tests that user memory overflow is rejected.</summary>
|
||||
[Fact]
|
||||
public void UserVMemoryToPdu_overflow_rejected()
|
||||
{
|
||||
@@ -51,6 +62,7 @@ public sealed class DirectLogicAddressTests
|
||||
Should.Throw<OverflowException>(() => DirectLogicAddress.UserVMemoryToPdu("V200000"));
|
||||
}
|
||||
|
||||
/// <summary>Tests that system memory base PDU is correctly set to 0x2100.</summary>
|
||||
[Fact]
|
||||
public void SystemVMemoryBasePdu_is_0x2100_for_V40400()
|
||||
{
|
||||
@@ -60,6 +72,7 @@ public sealed class DirectLogicAddressTests
|
||||
DirectLogicAddress.SystemVMemoryToPdu(0).ShouldBe((ushort)0x2100);
|
||||
}
|
||||
|
||||
/// <summary>Tests that system memory addresses correctly offset within bank.</summary>
|
||||
[Fact]
|
||||
public void SystemVMemoryToPdu_offsets_within_bank()
|
||||
{
|
||||
@@ -67,6 +80,7 @@ public sealed class DirectLogicAddressTests
|
||||
DirectLogicAddress.SystemVMemoryToPdu(0x100).ShouldBe((ushort)0x2200);
|
||||
}
|
||||
|
||||
/// <summary>Tests that system memory overflow is rejected.</summary>
|
||||
[Fact]
|
||||
public void SystemVMemoryToPdu_rejects_overflow()
|
||||
{
|
||||
@@ -77,6 +91,9 @@ public sealed class DirectLogicAddressTests
|
||||
|
||||
// --- Bit memory: Y-output, C-relay, X-input, SP-special ---
|
||||
|
||||
/// <summary>Tests that Y-output addresses correctly add octal offset to 2048.</summary>
|
||||
/// <param name="y">Y-prefixed octal address string.</param>
|
||||
/// <param name="expected">Expected coil address value.</param>
|
||||
[Theory]
|
||||
[InlineData("Y0", (ushort)2048)]
|
||||
[InlineData("Y1", (ushort)2049)]
|
||||
@@ -87,6 +104,9 @@ public sealed class DirectLogicAddressTests
|
||||
public void YOutputToCoil_adds_octal_offset_to_2048(string y, ushort expected)
|
||||
=> DirectLogicAddress.YOutputToCoil(y).ShouldBe(expected);
|
||||
|
||||
/// <summary>Tests that C-relay addresses correctly add octal offset to 3072.</summary>
|
||||
/// <param name="c">C-prefixed octal address string.</param>
|
||||
/// <param name="expected">Expected coil address value.</param>
|
||||
[Theory]
|
||||
[InlineData("C0", (ushort)3072)]
|
||||
[InlineData("C1", (ushort)3073)]
|
||||
@@ -95,6 +115,9 @@ public sealed class DirectLogicAddressTests
|
||||
public void CRelayToCoil_adds_octal_offset_to_3072(string c, ushort expected)
|
||||
=> DirectLogicAddress.CRelayToCoil(c).ShouldBe(expected);
|
||||
|
||||
/// <summary>Tests that X-input addresses correctly add octal offset to 0.</summary>
|
||||
/// <param name="x">X-prefixed octal address string.</param>
|
||||
/// <param name="expected">Expected discrete address value.</param>
|
||||
[Theory]
|
||||
[InlineData("X0", (ushort)0)]
|
||||
[InlineData("X17", (ushort)15)]
|
||||
@@ -102,6 +125,9 @@ public sealed class DirectLogicAddressTests
|
||||
public void XInputToDiscrete_adds_octal_offset_to_0(string x, ushort expected)
|
||||
=> DirectLogicAddress.XInputToDiscrete(x).ShouldBe(expected);
|
||||
|
||||
/// <summary>Tests that special-purpose bit addresses correctly add octal offset to 1024.</summary>
|
||||
/// <param name="sp">SP-prefixed octal address string.</param>
|
||||
/// <param name="expected">Expected discrete address value.</param>
|
||||
[Theory]
|
||||
[InlineData("SP0", (ushort)1024)]
|
||||
[InlineData("SP7", (ushort)1031)]
|
||||
@@ -110,6 +136,8 @@ public sealed class DirectLogicAddressTests
|
||||
public void SpecialToDiscrete_adds_octal_offset_to_1024(string sp, ushort expected)
|
||||
=> DirectLogicAddress.SpecialToDiscrete(sp).ShouldBe(expected);
|
||||
|
||||
/// <summary>Tests that non-octal digits in bit addresses are rejected.</summary>
|
||||
/// <param name="bad">Bit address with invalid octal digits.</param>
|
||||
[Theory]
|
||||
[InlineData("Y8")]
|
||||
[InlineData("C9")]
|
||||
@@ -122,6 +150,8 @@ public sealed class DirectLogicAddressTests
|
||||
else DirectLogicAddress.XInputToDiscrete(bad);
|
||||
});
|
||||
|
||||
/// <summary>Tests that empty input for bit addresses is rejected.</summary>
|
||||
/// <param name="bad">Empty or incomplete bit address.</param>
|
||||
[Theory]
|
||||
[InlineData("Y")]
|
||||
[InlineData("C")]
|
||||
@@ -129,10 +159,12 @@ public sealed class DirectLogicAddressTests
|
||||
public void Bit_address_rejects_empty(string bad)
|
||||
=> Should.Throw<ArgumentException>(() => DirectLogicAddress.YOutputToCoil(bad));
|
||||
|
||||
/// <summary>Tests that Y-output addresses accept lowercase prefix.</summary>
|
||||
[Fact]
|
||||
public void YOutputToCoil_accepts_lowercase_prefix()
|
||||
=> DirectLogicAddress.YOutputToCoil("y0").ShouldBe((ushort)2048);
|
||||
|
||||
/// <summary>Tests that C-relay addresses accept bare octal without C prefix.</summary>
|
||||
[Fact]
|
||||
public void CRelayToCoil_accepts_bare_octal_without_C_prefix()
|
||||
=> DirectLogicAddress.CRelayToCoil("0").ShouldBe((ushort)3072);
|
||||
|
||||
Reference in New Issue
Block a user