public void ComputeChecksum_Exception_Value_Null() { byte[] bytes = null; var crc = new CRC16_ANSI(); Assert.Throws <ArgumentNullException>(() => crc.ComputeChecksum(bytes)); }
public void ComputeChecksum_String_Valid(string value, ushort expected) { var crc = new CRC16_ANSI(); var result = crc.ComputeChecksum(value); Assert.Equal(expected, result); }
public void ComputeChecksum_Bytes_Valid(string value, ushort expected) { var bytes = Encoding.ASCII.GetBytes(value); var crc = new CRC16_ANSI(); var result = crc.ComputeChecksum(bytes); Assert.Equal(expected, result); }
public void ComputeChecksum_Exception_Value_Empty() { var crc = new CRC16_ANSI(); Assert.Throws <ArgumentNullException>(() => crc.ComputeChecksum(new byte[] { })); }