public void SwapsEndiannessMidLittleEndian() { // Arrange var data = (uint)0x01020304; // Act var expected = (uint)0x02010403; var actual1 = ModbusUtils.ConvertBetweenLittleEndianAndMidLittleEndian(data); var actual2 = ModbusUtils.ConvertBetweenLittleEndianAndMidLittleEndian(actual1); // Assert Assert.Equal(expected, actual1); Assert.Equal(data, actual2); }