forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_320Test.java
41 lines (34 loc) · 1.02 KB
/
_320Test.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
package com.fishercoder;
import com.fishercoder.solutions._320;
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 org.junit.Assert.assertTrue;
/**
* Created by fishercoder on 2/10/17.
*/
public class _320Test {
private static _320 test;
private static List<String> expected;
private static List<String> actual;
private static String word;
@BeforeClass
public static void setup(){
test = new _320();
}
@Before
public void setupForEachTest(){
expected = new ArrayList<>();
actual = new ArrayList<>();
}
@Test
public void test1(){
word = "word";
expected = Arrays.asList("word", "1ord", "w1rd", "wo1d", "wor1", "2rd", "w2d", "wo2", "1o1d", "1or1", "w1r1", "1o2", "2r1", "3d", "w3", "4");
actual = test.generateAbbreviations(word);
assertTrue(expected.containsAll(actual) && actual.containsAll(expected));
}
}