forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_422Test.java
59 lines (50 loc) · 1.34 KB
/
_422Test.java
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
50
51
52
53
54
55
56
57
58
59
package com.fishercoder;
import com.fishercoder.solutions._422;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static junit.framework.Assert.assertEquals;
public class _422Test {
private static _422 test;
private static boolean expected;
private static boolean actual;
private static List<String> words;
@BeforeClass
public static void setup(){
test = new _422();
}
@Before
public void setupForEachTest(){}
@Test
public void test1(){
words = new ArrayList<>(Arrays.asList("abcd","bnrt","crmy","dtye"));
expected = true;
actual = test.validWordSquare(words);
assertEquals(expected, actual);
}
@Test
public void test2(){
// abcd
// bnrt
// crm
// dt
words = new ArrayList<>(Arrays.asList("abcd","bnrt","crm","dt"));
expected = true;
actual = test.validWordSquare(words);
assertEquals(expected, actual);
}
@Test
public void test3(){
//ball
//asee
//let
//lep
words = new ArrayList<>(Arrays.asList("ball","asee","let","lep"));
expected = false;
actual = test.validWordSquare(words);
assertEquals(expected, actual);
}
}