public void ToInt32BigEndianWithOffset_4ZeroBytes_ZeroInt32() { byte[] data = new byte[] { 0, 0, 0, 0, 0 }; Assert.AreEqual(0, BytesConverter.ToInt32BigEndian(data, 1)); }
public void ToInt32BigEndianWithOffset_4Bytes_MaxInt32() { byte[] data = new byte[] { 0, 0, 0, 127, 255, 255, 255 }; Assert.AreEqual(int.MaxValue, BytesConverter.ToInt32BigEndian(data, 3)); }
public void ToInt32BigEndianWithoutOffset_4Bytes_HalfMaxInt32() { byte[] data = new byte[] { 63, 255, 255, 255 }; Assert.AreEqual(int.MaxValue / 2, BytesConverter.ToInt32BigEndian(data, 0)); }