Exemple #1
0
 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("")));
 }
Exemple #2
0
 public void TestHexDecode_ShouldThrowArgumentNullException_WhenNullValue()
 {
     EncodingUtils.HexDecode(null);
 }
Exemple #3
0
 public void TestHexDecode_ShouldThrowFormatException_WhenNotAnHexValue()
 {
     EncodingUtils.HexDecode("not an hex string!");
 }