harden(modbus-rtu): factory throws on unknown transport + document RTU FC-shape assumption

Claude-Session: https://claude.ai/code/session_01GASWkNEi68FSCtvr6rLoEW
This commit is contained in:
Joseph Doherty
2026-07-24 15:33:49 -04:00
parent 4a8c9badce
commit fcc7ed698e
3 changed files with 16 additions and 4 deletions
@@ -19,4 +19,9 @@ public sealed class ModbusTransportFactoryTests
public void Default_options_build_tcp_transport()
=> ModbusTransportFactory.Create(new ModbusDriverOptions())
.ShouldBeOfType<ModbusTcpTransport>();
[Fact]
public void Unknown_transport_mode_throws()
=> Should.Throw<ArgumentOutOfRangeException>(
() => ModbusTransportFactory.Create(new ModbusDriverOptions { Transport = (ModbusTransportMode)999 }));
}