fix(modbus): surface Int64/UInt64 node DataType (Driver.Modbus-007)

Make MapDataType internal, split the combined Int64/UInt64 arm to return
DriverDataType.Int64 and DriverDataType.UInt64 respectively, and remove
the now-stale Driver.Modbus-007 caveat doc block and inline comment.
Add a Theory covering both cases; full suite 271/271 green.
This commit is contained in:
Joseph Doherty
2026-06-16 05:23:47 -04:00
parent 97c087f2af
commit bd8fee610b
2 changed files with 15 additions and 20 deletions
@@ -1,6 +1,7 @@
using System.Buffers.Binary;
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
using ZB.MOM.WW.OtOpcUa.Driver.Modbus;
namespace ZB.MOM.WW.OtOpcUa.Driver.Modbus.Tests;
@@ -278,6 +279,17 @@ public sealed class ModbusDataTypeTests
ModbusDriver.DecodeRegister(wire, lo).ShouldBe("eH");
}
// --- MapDataType node DataType advertisement ---
/// <summary>
/// Verifies that 64-bit Modbus types surface the correct DriverDataType (not the stale Int32 fallback).
/// </summary>
[Theory]
[InlineData(ModbusDataType.Int64, DriverDataType.Int64)]
[InlineData(ModbusDataType.UInt64, DriverDataType.UInt64)]
public void MapDataType_64bit_surfaces_correct_DriverDataType(ModbusDataType wire, DriverDataType expected)
=> ModbusDriver.MapDataType(wire).ShouldBe(expected);
// --- BCD (binary-coded decimal, DL205/DL260 default numeric encoding) ---
/// <summary>