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