From 28e41757f11ea216f641b4889bd43be2b6373484 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Tue, 17 Mar 2009 09:34:18 -0400 Subject: 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. --- .../event/precondition/SwitchPreconditionTest.java | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPreconditionTest.java (limited to 'test') 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 @@ +package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +import com.fourisland.fourpuzzle.Game; +import com.fourisland.fourpuzzle.SaveFile; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author hatkirby + */ +public class SwitchPreconditionTest { + + public SwitchPreconditionTest() { + } + + String switchName = "TestSwitch"; + SwitchPrecondition sp; + + @Before + public void setUp() + { + Game.setSaveFile(new SaveFile()); + sp = new SwitchPrecondition(switchName); + } + + @Test + public void testUnsetSwitch() + { + Game.getSaveFile().getSwitches().put(switchName, false); + assertFalse(sp.match()); + } + + @Test + public void testSetSwitch() + { + Game.getSaveFile().getSwitches().put(switchName, true); + assertTrue(sp.match()); + } + + @After + public void tearDown() { + } + +} \ No newline at end of file -- cgit 1.4.1