Skip to content

Commit 98589d9

Browse files
authored
Update MonoAlphabetic.java
1 parent 2bd00f8 commit 98589d9

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
package com.thealgorithms.ciphers;
22

3-
import static org.junit.jupiter.api.Assertions.assertEquals;
4-
5-
import java.util.stream.Stream;
6-
7-
import org.junit.jupiter.params.ParameterizedTest;
8-
import org.junit.jupiter.params.provider.Arguments;
9-
import org.junit.jupiter.params.provider.MethodSource;
10-
113
public final class MonoAlphabetic {
124

135
// Private constructor to prevent instantiation of utility class
@@ -53,40 +45,4 @@ public static int getIndex(char c, String key) {
5345
}
5446
return -1; // Return -1 if character not found (should not happen for valid inputs)
5547
}
56-
57-
// *********** Unit Test Section **************
58-
59-
// Method to provide test data for encryption
60-
private static Stream<Arguments> provideEncryptionData() {
61-
String key = "MNBVCXZLKJHGFDSAPOIUYTREWQ";
62-
return Stream.of(
63-
// Input data, key, expected encrypted output
64-
Arguments.of("HELLO", key, "GFSSD"),
65-
Arguments.of("JAVA", key, "MZSM")
66-
);
67-
}
68-
69-
// Test for encryption
70-
@ParameterizedTest
71-
@MethodSource("provideEncryptionData")
72-
public void testEncrypt(String data, String key, String expected) {
73-
assertEquals(expected, MonoAlphabetic.encrypt(data, key));
74-
}
75-
76-
// Method to provide test data for decryption
77-
private static Stream<Arguments> provideDecryptionData() {
78-
String key = "MNBVCXZLKJHGFDSAPOIUYTREWQ";
79-
return Stream.of(
80-
// Encrypted data, key, expected decrypted output
81-
Arguments.of("GFSSD", key, "HELLO"),
82-
Arguments.of("MZSM", key, "JAVA")
83-
);
84-
}
85-
86-
// Test for decryption
87-
@ParameterizedTest
88-
@MethodSource("provideDecryptionData")
89-
public void testDecrypt(String data, String key, String expected) {
90-
assertEquals(expected, MonoAlphabetic.decrypt(data, key));
91-
}
9248
}

0 commit comments

Comments
 (0)