/
NikolayIvkin
/
TheAlgorithms
Обзор
Документация
Войти
/
NikolayIvkin
/
TheAlgorithms
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/test/java/com/thealgorithms/ciphers/SimpleSubCipherTest.java
36 строк
990 B
acbin
style: format code (#4212)
09 июн 2023, 13:52
Не верифицирован
09 июн 2023, 13:52
00282ef
Код
Авторство
О чём код?
package com.thealgorithms.ciphers; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; class SimpleSubCipherTest { SimpleSubCipher simpleSubCipher = new SimpleSubCipher(); @Test void simpleSubCipherEncryptTest() { // given String text = "defend the east wall of the castle"; String cipherSmall = "phqgiumeaylnofdxjkrcvstzwb"; // when String cipherText = simpleSubCipher.encode(text, cipherSmall); // then assertEquals("giuifg cei iprc tpnn du cei qprcni", cipherText); } @Test void simpleSubCipherDecryptTest() { // given String encryptedText = "giuifg cei iprc tpnn du cei qprcni"; String cipherSmall = "phqgiumeaylnofdxjkrcvstzwb"; // when String decryptedText = simpleSubCipher.decode(encryptedText, cipherSmall); // then assertEquals("defend the east wall of the castle", decryptedText); } }