- Notifications
You must be signed in to change notification settings - Fork 19.9k
/
Copy pathBaconianCipherTest.java
34 lines (24 loc) · 822 Bytes
/
BaconianCipherTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
packagecom.thealgorithms.ciphers;
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
importorg.junit.jupiter.api.Test;
classBaconianCipherTest {
BaconianCipherbaconianCipher = newBaconianCipher();
@Test
voidbaconianCipherEncryptTest() {
// given
Stringplaintext = "MEET AT DAWN";
// when
StringcipherText = baconianCipher.encrypt(plaintext);
// then
assertEquals("ABBAAAABAAAABAABAABBAAAAABAABBAAABBAAAAABABBAABBAB", cipherText);
}
@Test
voidbaconianCipherDecryptTest() {
// given
Stringciphertext = "ABBAAAABAAAABAABAABBAAAAABAABBAAABBAAAAABABBAABBAB";
// when
StringplainText = baconianCipher.decrypt(ciphertext);
// then
assertEquals("MEETATDAWN", plainText);
}
}