net.sf.gridarta.actions
public class ExitConnectorActionsTest extends Object
ExitConnectorActions
.Modifier and Type | Field and Description |
---|---|
private static File |
MAP_FILE1
The first map file.
|
private static File |
MAP_FILE2
The second map file.
|
private static String |
MAP_NAME1
The first map name.
|
private static String |
MAP_NAME2
The second map name.
|
private TestMapModelHelper |
mapModelHelper
The
TestMapModelHelper instance. |
private TestMapControlCreator |
testMapControlCreator
The
TestMapControlCreator for creating maps. |
Constructor and Description |
---|
ExitConnectorActionsTest() |
Modifier and Type | Method and Description |
---|---|
private static void |
checkExit(MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel,
Point point,
int index,
String exitPath,
Point exitPoint)
Checks that a map model contains an exit game object.
|
private ExitConnectorActions<TestGameObject,TestMapArchObject,TestArchetype> |
createActions(ExitConnectorModel model)
Creates a new
ExitConnectorActions instance. |
void |
setUp()
Initializes the test case.
|
void |
testExitConnect1()
Checks that
ExitConnectorActions.doExitConnect(boolean,
MapControl, Point) does work. |
void |
testExitConnectAuto1()
Checks that
ExitConnectorActions.doExitConnect(boolean,
MapControl, Point) does work when auto-creating exit objects. |
void |
testExitCopy1()
Checks that
ExitConnectorActions.doExitCopy(boolean, MapControl,
Point) does work. |
void |
testExitPaste1()
Checks that
ExitConnectorActions.doExitPaste(boolean, MapControl,
Point) does work. |
void |
testExitPaste2()
Checks that
ExitConnectorActions.doExitPaste(boolean, MapControl,
Point) does not crash when connecting to an unsaved map. |
private void |
testPath(String mapPathFrom,
String mapPathTo,
String expectedExitPath)
Checks that an exit path is correctly generated.
|
void |
testPath1()
Checks that exit paths are correctly generated.
|
private static final String MAP_NAME1
private static final String MAP_NAME2
@Nullable private TestMapControlCreator testMapControlCreator
TestMapControlCreator
for creating maps.@Nullable private TestMapModelHelper mapModelHelper
TestMapModelHelper
instance.public ExitConnectorActionsTest()
public void testExitCopy1()
ExitConnectorActions.doExitCopy(boolean, MapControl,
Point)
does work.public void testExitPaste1() throws CannotInsertGameObjectException
ExitConnectorActions.doExitPaste(boolean, MapControl,
Point)
does work.CannotInsertGameObjectException
- if the test failspublic void testExitPaste2()
ExitConnectorActions.doExitPaste(boolean, MapControl,
Point)
does not crash when connecting to an unsaved map.public void testExitConnect1() throws CannotInsertGameObjectException
ExitConnectorActions.doExitConnect(boolean,
MapControl, Point)
does work.CannotInsertGameObjectException
- if the test failspublic void testExitConnectAuto1()
ExitConnectorActions.doExitConnect(boolean,
MapControl, Point)
does work when auto-creating exit objects.public void testPath1() throws CannotInsertGameObjectException
CannotInsertGameObjectException
- if the test failsprivate void testPath(@NotNull String mapPathFrom, @NotNull String mapPathTo, @NotNull String expectedExitPath) throws CannotInsertGameObjectException
mapPathFrom
- the map path to connect from; this map contains the
exit objectmapPathTo
- the map path to connect toexpectedExitPath
- the expected map in the exit objectCannotInsertGameObjectException
- if the test failspublic void setUp() throws DuplicateArchetypeException
DuplicateArchetypeException
- if the test case failsprivate ExitConnectorActions<TestGameObject,TestMapArchObject,TestArchetype> createActions(@NotNull ExitConnectorModel model)
ExitConnectorActions
instance.model
- the exit connector model to useprivate static void checkExit(@NotNull MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel, @NotNull Point point, int index, @Nullable String exitPath, @Nullable Point exitPoint)
mapModel
- the map model to checkpoint
- the position to checkindex
- the index to checkexitPath
- the expected exit path or null
if no exit
game object is expectedexitPoint
- the expected exit destination or null
if no
exit game object is expectedFeedback: webmaster
© 2003-2010 The Gridarta Developers. All rights reserved.