/
NikolayIvkin
/
TheAlgorithms
Обзор
Документация
Войти
/
NikolayIvkin
/
TheAlgorithms
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/test/java/com/thealgorithms/ciphers/BaconianCipherTest.java
34 строки
822 B
Benjamin Burstein
Add BaconianCipher (#5932)
22 окт 2024, 21:30
Не верифицирован
22 окт 2024, 21:30
87030af
Код
Авторство
О чём код?
package com.thealgorithms.ciphers; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; class BaconianCipherTest { BaconianCipher baconianCipher = new BaconianCipher(); @Test void baconianCipherEncryptTest() { // given String plaintext = "MEET AT DAWN"; // when String cipherText = baconianCipher.encrypt(plaintext); // then assertEquals("ABBAAAABAAAABAABAABBAAAAABAABBAAABBAAAAABABBAABBAB", cipherText); } @Test void baconianCipherDecryptTest() { // given String ciphertext = "ABBAAAABAAAABAABAABBAAAAABAABBAAABBAAAAABABBAABBAB"; // when String plainText = baconianCipher.decrypt(ciphertext); // then assertEquals("MEETATDAWN", plainText); } }