public void TestHexDecode() { Assert.IsTrue(new byte[1].SequenceEqual(EncodingUtils.HexDecode("00"))); Assert.IsTrue(Encoding.ASCII.GetBytes("some data").SequenceEqual(EncodingUtils.HexDecode("736f6d652064617461"))); Assert.IsTrue(Encoding.ASCII.GetBytes("some data").SequenceEqual(EncodingUtils.HexDecode("736F6D652064617461"))); Assert.IsTrue(Encoding.ASCII.GetBytes("").SequenceEqual(EncodingUtils.HexDecode(""))); }
public void TestHexDecode_ShouldThrowArgumentNullException_WhenNullValue() { EncodingUtils.HexDecode(null); }
public void TestHexDecode_ShouldThrowFormatException_WhenNotAnHexValue() { EncodingUtils.HexDecode("not an hex string!"); }