-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjUnitTest.java
More file actions
30 lines (21 loc) · 804 Bytes
/
jUnitTest.java
File metadata and controls
30 lines (21 loc) · 804 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.Assert;
import org.junit.Test;
public class AnagramTest {
@Test
public void testFindAllAnagramsInText() {
String text = "cbaebabacd";
String pattern = "abc";
List<Integer> expected = Arrays.asList(0, 6);
List<Integer> result = AnagramFinder.findAllAnagramsInText(text, pattern);
Assert.assertEquals(expected, result);
}
@Test
public void testFindAllAnagramsInText_NoAnagramFound() {
String text = "abcd";
String pattern = "xyz";
List<Integer> expected = Collections.emptyList();
List<Integer> result = AnagramFinder.findAllAnagramsInText(text, pattern);
Assert.assertEquals(expected, result);
}
// Các ca kiểm thử khác...
}