-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameTest.java
More file actions
29 lines (26 loc) · 818 Bytes
/
Copy pathGameTest.java
File metadata and controls
29 lines (26 loc) · 818 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
import org.junit.*;
import static org.junit.Assert.*;
public class GameTest {
/**
* This is an example test. You can delete it.
*/
@Test
public void exampleTest() {
assertEquals("1 + 1 should equal 2", 2, 1 + 1);
assertTrue("3 should be less than 4", 3 < 4);
}
@Test
public void generateAndProcess(){
BoundedQueue<Action> queue = new BoundedQueue<Action>(10, true);
Action ma = new MoveAction(1, 10);
queue.put(ma);
ma = new MoveAction(6, -2);
queue.put(ma);
ma = new MoveAction(-3, 12);
queue.put(ma);
Game game = new Game();
game.generateMovements(queue);
game.process(queue);
assertTrue("x should be 6, and y should be 17", (game.getX() == 6 && game.getY() == 17));
}
}