Пример #1
0
        public void HexStringToByteArray_ShouldProduceExpectedBytes()
        {
            var str   = "fffe00";
            var bytes = ByteArrayUtils.HexStringToByteArray(str);

            Assert.IsTrue(ByteArrayUtils.AreEqual(bytes, new byte[] { 0xff, 0xfe, 0x00 }));
        }
Пример #2
0
 public void AreEqual_ShouldReturnTrueForIdentical()
 {
     Assert.IsTrue(ByteArrayUtils.AreEqual(new byte[] { 0xff, 0xfe, 0xfd }, new byte[] { 0xff, 0xfe, 0xfd }));
 }
Пример #3
0
 public void AreEqual_ShouldHandleInequalLength()
 {
     Assert.IsFalse(ByteArrayUtils.AreEqual(new byte[] { 0xff, 0xfe, 0xfd }, new byte[] { 0xff, 0xfe, 0xfd, 0xfc }));
 }
Пример #4
0
 public void AreEqual_ShouldHandleNulls()
 {
     Assert.IsTrue(ByteArrayUtils.AreEqual(null, null));
 }