summary refs log tree commit diff stats
path: root/test/com
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-03-17 09:34:18 -0400
committerStarla Insigna <hatkirby@fourisland.com>2009-03-17 09:34:18 -0400
commit28e41757f11ea216f641b4889bd43be2b6373484 (patch)
tree4d29231ca35702afd9e5bfad17b1c170098fc9aa /test/com
parent0a5ace745f171cad0150dbed11ae8febc0e17f27 (diff)
downloadfourpuzzle-28e41757f11ea216f641b4889bd43be2b6373484.tar.gz
fourpuzzle-28e41757f11ea216f641b4889bd43be2b6373484.tar.bz2
fourpuzzle-28e41757f11ea216f641b4889bd43be2b6373484.zip
Engine: Added ShakeScreen() special action
Also implemented F12 to return to the title screen and added a move frequency variable to events that decides how often they move.
Diffstat (limited to 'test/com')
-rw-r--r--test/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPreconditionTest.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPreconditionTest.java b/test/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPreconditionTest.java new file mode 100644 index 0000000..bc86459 --- /dev/null +++ b/test/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPreconditionTest.java
@@ -0,0 +1,52 @@
1package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition;
2
3/*
4 * To change this template, choose Tools | Templates
5 * and open the template in the editor.
6 */
7
8import com.fourisland.fourpuzzle.Game;
9import com.fourisland.fourpuzzle.SaveFile;
10import org.junit.After;
11import org.junit.Before;
12import org.junit.Test;
13import static org.junit.Assert.*;
14
15/**
16 *
17 * @author hatkirby
18 */
19public class SwitchPreconditionTest {
20
21 public SwitchPreconditionTest() {
22 }
23
24 String switchName = "TestSwitch";
25 SwitchPrecondition sp;
26
27 @Before
28 public void setUp()
29 {
30 Game.setSaveFile(new SaveFile());
31 sp = new SwitchPrecondition(switchName);
32 }
33
34 @Test
35 public void testUnsetSwitch()
36 {
37 Game.getSaveFile().getSwitches().put(switchName, false);
38 assertFalse(sp.match());
39 }
40
41 @Test
42 public void testSetSwitch()
43 {
44 Game.getSaveFile().getSwitches().put(switchName, true);
45 assertTrue(sp.match());
46 }
47
48 @After
49 public void tearDown() {
50 }
51
52} \ No newline at end of file