public void Initialize() { ModbusMessageImpl messageImpl = new ModbusMessageImpl(); messageImpl.Initialize(new byte[] {1, 2, 9, 9, 9, 9}); Assert.AreEqual(1, messageImpl.SlaveAddress); Assert.AreEqual(2, messageImpl.FunctionCode); }
public ModbusMessage(byte slaveAddress, byte functionCode) { _messageImpl = new ModbusMessageImpl(slaveAddress, functionCode); }
public ModbusMessage() { _messageImpl = new ModbusMessageImpl(); }
public void ProtocolDataUnit() { ModbusMessageImpl messageImpl = new ModbusMessageImpl(11, Modbus.ReadCoils); byte[] expectedResult = {Modbus.ReadCoils}; Assert.AreEqual(expectedResult, messageImpl.ProtocolDataUnit); }
public void ModbusMessageCtorInitializesProperties() { ModbusMessageImpl messageImpl = new ModbusMessageImpl(5, Modbus.ReadCoils); Assert.AreEqual(5, messageImpl.SlaveAddress); Assert.AreEqual(Modbus.ReadCoils, messageImpl.FunctionCode); }
public void MessageFrame() { ModbusMessageImpl messageImpl = new ModbusMessageImpl(11, Modbus.ReadHoldingRegisters); byte[] expectedMessageFrame = {11, Modbus.ReadHoldingRegisters}; Assert.AreEqual(expectedMessageFrame, messageImpl.MessageFrame); }
public void InitializeInvalidFrame() { ModbusMessageImpl messageImpl = new ModbusMessageImpl(); messageImpl.Initialize(new byte[] {1}); }
public void ChecckInitializeFrameNull() { ModbusMessageImpl messageImpl = new ModbusMessageImpl(); messageImpl.Initialize(null); }
public void ChecckInitializeFrameNull() { ModbusMessageImpl messageImpl = new ModbusMessageImpl(); Assert.Throws<ArgumentNullException>(() => messageImpl.Initialize(null)); }
public void InitializeInvalidFrame() { ModbusMessageImpl messageImpl = new ModbusMessageImpl(); Assert.Throws<FormatException>(() => messageImpl.Initialize(new byte[] {1})); }
/// <summary> /// /// </summary> protected ModbusMessage() { _messageImpl = new ModbusMessageImpl(); }
internal AbstractModbusMessage(byte slaveAddress, byte functionCode) { _messageImpl = new ModbusMessageImpl(slaveAddress, functionCode); }
internal AbstractModbusMessage() { _messageImpl = new ModbusMessageImpl(); }