mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 14:34:05 +08:00
23
src/test/java/com/thealgorithms/others/CRC16Test.java
Normal file
23
src/test/java/com/thealgorithms/others/CRC16Test.java
Normal file
@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user