More cleanup and adds some helper functions to new utility classes
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package net.knarcraft.bookswithoutborders;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class GenenCryptTest {
|
||||
|
||||
@Test
|
||||
public void encryptDecryptTest() {
|
||||
GenenCrypt gc = new GenenCrypt("Another Key");
|
||||
gc.printCodonTable();
|
||||
String encrypted = gc.encrypt("Hello World!");
|
||||
assertEquals("HELLO WORLD!", gc.decrypt(encrypted));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package net.knarcraft.bookswithoutborders.util;
|
||||
|
||||
import net.knarcraft.bookswithoutborders.utility.EncryptionHelper;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class EncryptionHelperTest {
|
||||
|
||||
@Test
|
||||
public void getNumberKeyFromStringKey() {
|
||||
String numberKey = EncryptionHelper.getNumberKeyFromStringKey("hello");
|
||||
assertEquals("1714212124", numberKey);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user