forked from kiwi-coder/Rich-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapTest.java
More file actions
38 lines (32 loc) · 934 Bytes
/
MapTest.java
File metadata and controls
38 lines (32 loc) · 934 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
37
38
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
public class MapTest {
private static final int DUMMY_MONEY = 0;
private Map map;
@Before
public void setUp() throws Exception {
map = TestHelper.simpleMap();
}
@Test
public void test_map_size() {
assertThat(map.size(), is(8));
}
@Test
public void test_map_layout() {
String expected = "000\n"
+ "0 0\n"
+ "000\n";
assertThat(map.display(), is(expected));
}
@Test
public void test_display_ATuBo_at_starting_position() {
String expected = "A00\n"
+ "0 0\n"
+ "000\n";
Player player = new Player("ATuBo", map.getSite(0), DUMMY_MONEY);
assertThat(map.display(), is(expected));
}
}