Remove duplicate file of Simple Substitution Cipher (fixes #4494) (#4495)

This commit is contained in:
aryan1165
2023-12-26 03:54:28 +05:30
committed by GitHub
parent e26fd9da71
commit 7ece806cf5
3 changed files with 0 additions and 133 deletions

View File

@ -1,48 +0,0 @@
package com.thealgorithms.ciphers;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
public class SimpleSubstitutionCipherTest {
@Test
void testEncode() {
// Given
String message = "HELLOWORLD";
String key = "phqgiumeaylnofdxjkrcvstzwb";
// When
String actual = SimpleSubstitutionCipher.encode(message, key);
// Then
assertEquals("EINNDTDKNG", actual);
}
@Test
void testDecode() {
// Given
String message = "EINNDTDKNG";
String key = "phqgiumeaylnofdxjkrcvstzwb";
// When
String actual = SimpleSubstitutionCipher.decode(message, key);
// Then
assertEquals("HELLOWORLD", actual);
}
@Test
void testIsTextTheSameAfterEncodeAndDecode() {
// Given
String text = "HELLOWORLD";
String key = "phqgiumeaylnofdxjkrcvstzwb";
// When
String encodedText = SimpleSubstitutionCipher.encode(text, key);
String decodedText = SimpleSubstitutionCipher.decode(encodedText, key);
// Then
assertEquals(text, decodedText);
}
}