jfreerails.move
Class AbstractMoveTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
jfreerails.move.AbstractMoveTestCase
- All Implemented Interfaces:
- junit.framework.Test
public abstract class AbstractMoveTestCase
- extends junit.framework.TestCase
All TestCases for moves should extend this class.
- Author:
- Luke
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
hasSetupBeenCalled
private boolean hasSetupBeenCalled
world
protected World world
AbstractMoveTestCase
protected AbstractMoveTestCase()
AbstractMoveTestCase
public AbstractMoveTestCase(java.lang.String str)
assertDoMoveFails
protected void assertDoMoveFails(Move m)
assertDoMoveIsOk
protected void assertDoMoveIsOk(Move m)
assertDoThenUndoLeavesWorldUnchanged
protected void assertDoThenUndoLeavesWorldUnchanged(Move m)
assertSurvivesSerialisation
protected void assertSurvivesSerialisation(FreerailsSerializable m)
- This method asserts that if we serialise then deserialise the specified
move, the specified move is equal to the deserialised move. The assertion
depends on the move being serialisable and the equals method being
implemented correctly. Also checks that the hashcode does not change.
- Parameters:
m
-
assertOkAndRepeatable
protected void assertOkAndRepeatable(Move m)
assertOkButNotRepeatable
protected void assertOkButNotRepeatable(Move m)
- Generally moves should not be repeatable. For example, if we have just
removed a piece of track, that piece of track is gone, so we cannot
remove it again.
assertSetupHasBeenCalled
private void assertSetupHasBeenCalled()
assertTryMoveFails
protected void assertTryMoveFails(Move m)
assertTryMoveIsOk
protected void assertTryMoveIsOk(Move m)
assertTryUndoMoveFails
protected void assertTryUndoMoveFails(Move m)
assertTryUndoMoveIsOk
protected void assertTryUndoMoveIsOk(Move m)
assertUndoMoveFails
protected void assertUndoMoveFails(Move m)
assertUndoMoveIsOk
protected void assertUndoMoveIsOk(Move m)
getPrincipal
FreerailsPrincipal getPrincipal()
getWorld
World getWorld()
hasSetupBeenCalled
protected boolean hasSetupBeenCalled()
setHasSetupBeenCalled
protected void setHasSetupBeenCalled(boolean hasSetupBeenCalled)
setUp
protected void setUp()
throws java.lang.Exception
- Overrides:
setUp
in class junit.framework.TestCase
- Throws:
java.lang.Exception
setupWorld
protected void setupWorld()
setWorld
void setWorld(World world)
testMove
public void testMove()
assertTrackHere
protected void assertTrackHere(int x,
int y)
assertTrackHere
protected void assertTrackHere(PathOnTiles path)