コード例 #1
0
 public void ToBytesTest(string hexStr, Type exType)
 {
     if (exType != null)
     {
         Assert.Throws(exType, () => HexStringExtensions.ToBytes(hexStr));
     }
     else
     {
         Assert.True(HexStringExtensions.ToBytes(hexStr).Length > 0);
     }
 }
コード例 #2
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);
     }
 }
コード例 #3
0
 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);
     }
 }