Ejemplo n.º 1
0
        public void ConvertsCorrectly(byte[] bytes, string expectedHex)
        {
            string hex = HexConvert.ToHexString(bytes);

            Assert.Equal(expectedHex, hex);

            byte[] resultBytes = HexConvert.FromHexString(hex);
            Assert.Equal(bytes, resultBytes);
        }
Ejemplo n.º 2
0
 public void ThrowsWhenHexStringNull()
 {
     Assert.Throws <ArgumentNullException>(() => HexConvert.FromHexString(null));
 }
 public static byte[] ParseAsHex(this string value) => HexConvert.FromHexString(value);