forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_1170Test.java
More file actions
49 lines (40 loc) · 1.37 KB
/
_1170Test.java
File metadata and controls
49 lines (40 loc) · 1.37 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.fishercoder;
import com.fishercoder.solutions._1170;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertArrayEquals;
public class _1170Test {
private static _1170.Solution1 solution1;
private static _1170.Solution2 solution2;
private static String[] queries;
private static String[] words;
@BeforeClass
public static void setup() {
solution1 = new _1170.Solution1();
solution2 = new _1170.Solution2();
}
@Test
public void test1() {
queries = new String[]{"cbd"};
words = new String[]{"zaaaz"};
assertArrayEquals(new int[]{1}, solution1.numSmallerByFrequency(queries, words));
}
@Test
public void test2() {
queries = new String[]{"bbb", "cc"};
words = new String[]{"a", "aa", "aaa", "aaaa"};
assertArrayEquals(new int[]{1, 2}, solution1.numSmallerByFrequency(queries, words));
}
@Test
public void test3() {
queries = new String[]{"cbd"};
words = new String[]{"zaaaz"};
assertArrayEquals(new int[]{1}, solution2.numSmallerByFrequency(queries, words));
}
@Test
public void test4() {
queries = new String[]{"bbb", "cc"};
words = new String[]{"a", "aa", "aaa", "aaaa"};
assertArrayEquals(new int[]{1, 2}, solution2.numSmallerByFrequency(queries, words));
}
}