File tree 1 file changed +4
-3
lines changed
src/test/java/com/thealgorithms/ciphers
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
package com .thealgorithms .ciphers ;
2
2
3
3
import static org .junit .jupiter .api .Assertions .assertEquals ;
4
+
4
5
import org .junit .jupiter .api .BeforeEach ;
5
6
import org .junit .jupiter .api .Test ;
6
7
@@ -19,7 +20,7 @@ public void testEncrypt() {
19
20
String plaintext = "HELLO" ;
20
21
String expectedCiphertext = "ITSSG" ; // Expected result based on the key
21
22
String actualCiphertext = monoAlphabetic .encrypt (plaintext );
22
-
23
+
23
24
assertEquals (expectedCiphertext , actualCiphertext , "Encryption should match the expected ciphertext." );
24
25
}
25
26
@@ -28,7 +29,7 @@ public void testDecrypt() {
28
29
String ciphertext = "ITSSG" ;
29
30
String expectedPlaintext = "HELLO" ; // Expected result based on the key
30
31
String actualPlaintext = monoAlphabetic .decrypt (ciphertext );
31
-
32
+
32
33
assertEquals (expectedPlaintext , actualPlaintext , "Decryption should match the expected plaintext." );
33
34
}
34
35
@@ -37,7 +38,7 @@ public void testEncryptAndDecrypt() {
37
38
String plaintext = "HELLO" ;
38
39
String ciphertext = monoAlphabetic .encrypt (plaintext );
39
40
String decryptedText = monoAlphabetic .decrypt (ciphertext );
40
-
41
+
41
42
assertEquals (plaintext , decryptedText , "Decrypting the ciphertext should return the original plaintext." );
42
43
}
43
44
You can’t perform that action at this time.
0 commit comments