File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
src/test/java/com/thealgorithms/ciphers Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .thealgorithms .ciphers ;
2
+
3
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
4
+
5
+ import org .junit .jupiter .api .Test ;
6
+
7
+ public class AtbashTest {
8
+
9
+ @ Test
10
+ public void atbashEncrypt () {
11
+ AtbashCipher normalToEncrypt = new AtbashCipher (
12
+ "Hello World! 123, @cipher abcDEF ZYX 987 madam zzZ Palindrome!" );
13
+ String expectedText = "Svool Dliow! 123, @xrksvi zyxWVU ABC 987 nzwzn aaA Kzormwilnv!" ;
14
+
15
+ normalToEncrypt .setString (normalToEncrypt .convert ());
16
+
17
+ assertEquals (expectedText , normalToEncrypt .getString ());
18
+ }
19
+
20
+ @ Test
21
+ public void atbashDecrypt () {
22
+ AtbashCipher encryptToNormal = new AtbashCipher (
23
+ "Svool Dliow! 123, @xrksvi zyxWVU ABC 987 nzwzn aaA Kzormwilnv!" );
24
+ String expectedText = "Hello World! 123, @cipher abcDEF ZYX 987 madam zzZ Palindrome!" ;
25
+
26
+ encryptToNormal .setString (encryptToNormal .convert ());
27
+
28
+ assertEquals (expectedText , encryptToNormal .getString ());
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments