-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUniqelem.test.java
More file actions
30 lines (25 loc) · 831 Bytes
/
Copy pathUniqelem.test.java
File metadata and controls
30 lines (25 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class UniqelemTest {
@Test
public void testGetUniqueElements() {
Uniqelem uniqelem = new Uniqelem();
List<String> result = uniqelem.getUniqueElements("a,b,c,d,a,b");
assertEquals(Arrays.asList("a", "b", "c", "d"), result);
}
@Test
public void testFound_True() {
String[] list = {"a", "b", "c"};
boolean result = Uniqelem.found("a", list);
assertEquals(true, result);
}
@Test
public void testFound_False() {
String[] list = {"a", "b", "c"};
boolean result = Uniqelem.found("d", list);
assertEquals(false, result);
}
// ... Additional test cases as necessary ...
}