public void ToBytesTest(string hexStr, Type exType) { if (exType != null) { Assert.Throws(exType, () => HexStringExtensions.ToBytes(hexStr)); } else { Assert.True(HexStringExtensions.ToBytes(hexStr).Length > 0); } }
public void ToHexStringTest(byte[] bin, Type exType, string result) { if (exType != null) { Assert.Throws(exType, () => HexStringExtensions.ToHexString(bin)); } else { Assert.Equal(HexStringExtensions.ToHexString(bin), result); } }
public void IsHexStringTest(string hexStr, Type exType, bool result) { if (exType != null) { Assert.Throws(exType, () => { Assert.Equal(HexStringExtensions.IsHexString(hexStr), result); }); } else { Assert.Equal(HexStringExtensions.IsHexString(hexStr), result); } }