-
Notifications
You must be signed in to change notification settings - Fork 0
/
MoveTest.java
41 lines (33 loc) · 1.01 KB
/
MoveTest.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
/* Author: Paul N. Hilfinger. (C) 2008. */
package ataxx;
import org.junit.Test;
import static org.junit.Assert.*;
import static ataxx.Move.*;
/** Test Move creation.
* @author P. N. Hilfinger
*/
public class MoveTest {
@Test
public void testPass() {
assertTrue("bad pass", pass() != null && pass().isPass());
assertEquals("bad pass string", "-", pass().toString());
}
@Test
public void testMove() {
Move m = move('a', '3', 'b', '2');
assertNotNull(m);
assertFalse("move is pass", m.isPass());
assertTrue("move not extend", m.isExtend());
m = move('b', '4', 'b', '5');
assertTrue("move not extend", m.isExtend());
assertFalse("move is jump", m.isJump());
}
@Test
public void testJump() {
Move m = move('a', '3', 'a', '5');
assertNotNull(m);
assertFalse("move is pass", m.isPass());
assertFalse("move is extend", m.isExtend());
assertTrue("move is not jump", m.isJump());
}
}