public void HexStringToByteArray_ShouldProduceExpectedBytes() { var str = "fffe00"; var bytes = ByteArrayUtils.HexStringToByteArray(str); Assert.IsTrue(ByteArrayUtils.AreEqual(bytes, new byte[] { 0xff, 0xfe, 0x00 })); }
public void AreEqual_ShouldReturnTrueForIdentical() { Assert.IsTrue(ByteArrayUtils.AreEqual(new byte[] { 0xff, 0xfe, 0xfd }, new byte[] { 0xff, 0xfe, 0xfd })); }
public void AreEqual_ShouldHandleInequalLength() { Assert.IsFalse(ByteArrayUtils.AreEqual(new byte[] { 0xff, 0xfe, 0xfd }, new byte[] { 0xff, 0xfe, 0xfd, 0xfc })); }
public void AreEqual_ShouldHandleNulls() { Assert.IsTrue(ByteArrayUtils.AreEqual(null, null)); }