Skip to content

Commit 74c3c87

Browse files
committed
Fix
1 parent 06ec601 commit 74c3c87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/java/com/thealgorithms/ciphers/ColumnarTranspositionCipherTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,19 @@ public void testEncryption() {
2929

3030
@Test
3131
public void testDecryption() {
32+
String encryptedText = ColumnarTranspositionCipher.encrpyter(plaintext, keyword);
3233
String decryptedText = ColumnarTranspositionCipher.decrypter();
3334

3435
assertEquals(plaintext.replaceAll(" ", ""), decryptedText.replaceAll(" ", ""), "The decrypted text should match the original plaintext, ignoring spaces.");
36+
assertEquals(encryptedText, ColumnarTranspositionCipher.encrpyter(plaintext, keyword), "The encrypted text should be the same when encrypted again.");
3537
}
3638

3739
@Test
3840
public void testLongPlainText() {
3941
String longText = "This is a significantly longer piece of text to test the encryption and decryption capabilities of the Columnar Transposition Cipher. It should handle long strings gracefully.";
42+
String encryptedText = ColumnarTranspositionCipher.encrpyter(longText, keyword);
4043
String decryptedText = ColumnarTranspositionCipher.decrypter();
41-
4244
assertEquals(longText.replaceAll(" ", ""), decryptedText.replaceAll(" ", ""), "The decrypted text should match the original long plaintext, ignoring spaces.");
45+
assertEquals(encryptedText, ColumnarTranspositionCipher.encrpyter(longText, keyword), "The encrypted text should be the same when encrypted again.");
4346
}
4447
}

0 commit comments

Comments
 (0)