-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy path_28Test.java
More file actions
36 lines (28 loc) · 785 Bytes
/
_28Test.java
File metadata and controls
36 lines (28 loc) · 785 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
31
32
33
34
35
36
package com.fishercoder;
import com.fishercoder.solutions._28;
import org.junit.Before;
import org.junit.Test;
import static junit.framework.TestCase.assertEquals;
public class _28Test {
private static _28.Solution1 solution1;
private static _28.Solution2 solution2;
@Before
public void setupForEachTest() {
solution1 = new _28.Solution1();
solution2 = new _28.Solution2();
}
@Test
public void test1() {
assertEquals(0, solution1.strStr("a", ""));
assertEquals(0, solution2.strStr("sadbutsad", "sad"));
}
@Test
public void test2() {
assertEquals(-1, solution1.strStr("mississippi", "a"));
assertEquals(8, solution2.strStr("leetcodea", "a"));
}
@Test
public void test3() {
assertEquals(0, solution1.strStr("a", "a"));
}
}