|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
test.GameStateTest
public class GameStateTest
Unit tests for the GameState class.
Constructor Summary | |
---|---|
GameStateTest(String name)
|
Method Summary | |
---|---|
protected void |
setUp()
|
void |
testCastle()
Check that you can castle when not passing through check, only if neither rook nor king has moved before. |
void |
testEnPassant()
Test that en passant works, but expires. |
void |
testForcing()
Test that the ability to capture forces the move. |
void |
testGetMoveNum()
Check that the move number increases as desired, and decreases when reverting a move. |
void |
testInvalidState()
Check that the GameState can find when the wrong player is in check. |
void |
testIsLegal()
Test that isLegal works. |
void |
testLegalMoves()
Test that legalMoves doesn't modify the state, and is correct for an easy case. |
void |
testNoMoves()
Test when you are forced to pass. |
void |
testPowerups()
Test that pawns promote at the end. |
void |
testQueening()
Test that pawns promote at the end. |
void |
testToString()
Test tostring after a move |
void |
testWinner()
Test the game's detection of the winner, in the various cases. |
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 |
Constructor Detail |
---|
public GameStateTest(String name)
Method Detail |
---|
protected void setUp()
setUp
in class TestCase
public void testGetMoveNum()
public void testInvalidState()
public void testLegalMoves()
public void testToString()
public void testCastle()
public void testForcing()
public void testEnPassant()
public void testQueening()
public void testIsLegal()
public void testNoMoves()
public void testWinner()
public void testPowerups()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |