bd6c0b4d3d
Add missing <returns>/<param>/<summary>/<typeparam> tags and clean up misused inheritdoc across 481 files so the documented API surface is complete. Documentation-only (zero code lines changed). The 131 remaining findings are inheritdoc-style warnings deliberately left to preserve hand-written implementation rationale (plan-decision notes, race-condition explanations).
27 lines
1.3 KiB
C#
27 lines
1.3 KiB
C#
using Shouldly;
|
|
using Xunit;
|
|
using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared.Drivers.Pickers;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.AdminUI.Tests.Pickers;
|
|
|
|
public sealed class S7AddressBuilderTests
|
|
{
|
|
/// <summary>Verifies that Build produces the canonical S7 address string for all supported areas and types.</summary>
|
|
/// <param name="area">The S7 memory area (DB / M / I / Q).</param>
|
|
/// <param name="dbNumber">The DB number (relevant only for the DB area).</param>
|
|
/// <param name="offset">The byte offset within the area.</param>
|
|
/// <param name="s7Type">The S7 data type qualifier (X / B / W / D / REAL).</param>
|
|
/// <param name="expected">The expected canonical address string.</param>
|
|
[Theory]
|
|
[InlineData("DB", 10, 20, "REAL", "DB10.DBD20:REAL")]
|
|
[InlineData("DB", 1, 0, "X", "DB1.DBX0.0:X")]
|
|
[InlineData("DB", 5, 4, "W", "DB5.DBW4:W")]
|
|
[InlineData("DB", 2, 6, "B", "DB2.DBB6:B")]
|
|
[InlineData("M", 1, 0, "X", "M0.0:X")]
|
|
[InlineData("M", 1, 4, "W", "M4:W")]
|
|
[InlineData("I", 1, 0, "B", "I0:B")]
|
|
[InlineData("Q", 1, 2, "W", "Q2:W")]
|
|
public void Build_Canonical(string area, int dbNumber, int offset, string s7Type, string expected)
|
|
=> S7AddressBuilder.Build(area, dbNumber, offset, s7Type).ShouldBe(expected);
|
|
}
|