forked from TheAlgorithms/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsomorphicTest.java
More file actions
23 lines (18 loc) · 1021 Bytes
/
IsomorphicTest.java
File metadata and controls
23 lines (18 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.thealgorithms.strings;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.stream.Stream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
public final class IsomorphicTest {
@ParameterizedTest
@MethodSource("inputs")
public void testCheckStrings(String str1, String str2, Boolean expected) {
assertEquals(expected, Isomorphic.areIsomorphic(str1, str2));
assertEquals(expected, Isomorphic.areIsomorphic(str2, str1));
}
private static Stream<Arguments> inputs() {
return Stream.of(Arguments.of("", "", Boolean.TRUE), Arguments.of("", "a", Boolean.FALSE), Arguments.of("aaa", "aa", Boolean.FALSE), Arguments.of("abbbbaac", "kffffkkd", Boolean.TRUE), Arguments.of("xyxyxy", "bnbnbn", Boolean.TRUE), Arguments.of("ghjknnmm", "wertpopo", Boolean.FALSE),
Arguments.of("aaammmnnn", "ggghhhbbj", Boolean.FALSE));
}
}