mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-28 15:02:46 +08:00
24 lines
449 B
Java
24 lines
449 B
Java
package com.thealgorithms.others;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
class CRC16Test {
|
|
|
|
CRC16 crc = new CRC16();
|
|
|
|
@Test
|
|
void testCRC16() {
|
|
// given
|
|
String textToCRC16 = "hacktoberfest!";
|
|
|
|
// when
|
|
String resultCRC16 = crc.crc16(textToCRC16); // Algorithm CRC16-CCITT-FALSE
|
|
|
|
// then
|
|
assertEquals("10FC", resultCRC16);
|
|
}
|
|
|
|
}
|