-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListTests.java
More file actions
47 lines (36 loc) · 1.04 KB
/
Copy pathListTests.java
File metadata and controls
47 lines (36 loc) · 1.04 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
package junit;
import org.junit.*;
import java.util.Arrays;
import java.util.List;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
public class ListTests {
private List<String> strings;
@BeforeClass
public static void initialization () {
System.out.println("Should run only once");
}
@AfterClass
public static void finish() {
System.out.println("Cleaning up ater all tests have run");
}
@Before
public void setUp () {
System.out.println("inside setUp");
strings = Arrays.asList("this", "is", "a", "list", "of", "strings");
}
@Test
public void defaultListHasCorrectSize() {
assertEquals("default list should have six strings", 6, strings.size());
strings = null;
}
@Test
public void defaultListHasSixStrings () {
assertThat(strings.size(), is(6));
}
@After
public void cleanUp () {
System.out.println("Cleaning up...");
}
}