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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user