示例#1
0
 public void CRC_Error()
 {
     Assert.Throws <ArgumentNullException>(() => LgbCRC16.ComputerHash(null));
     Assert.Throws <ArgumentNullException>(() => LgbCRC32.ComputerHash(null));
 }
示例#2
0
 public void ComputerHash_Ok()
 {
     Assert.Equal(850, LgbCRC16.ComputerHash(new byte[] { 0, 1, 3 }, CRC16Option.XModen));
     Assert.Equal(21186, LgbCRC16.ComputerHash(new byte[] { 2, 4, 6 }, CRC16Option.Modbus));
     Assert.Throws <ArgumentNullException>(() => LgbCRC16.ComputerHash(null, CRC16Option.XModen));
 }
示例#3
0
 public void CRC16_Ok(byte[] data, int result)
 {
     Assert.Equal(result, LgbCRC16.ComputerHash(data));
 }