public void SwapsEndiannessGeneric <T>(T[] dataset, T[] expected) where T : unmanaged { // Act ModbusUtils.SwitchEndianness(dataset.AsSpan()); var actual = dataset; // Assert Assert.Equal(actual, expected); }
public void SwapsEndiannessUShort() { // Arrange var data = (ushort)512; // Act var expected = (ushort)2; var actual = ModbusUtils.SwitchEndianness(data); // Assert Assert.Equal(actual, expected); }