added som javadoc in the PieceTest-class
This commit is contained in:
@@ -62,22 +62,24 @@ public void broadcast(ServerMessage message) {
|
||||
//declare player-Client here
|
||||
playerClient = new Player(nameClient);
|
||||
clientColor = Color.ARMY;
|
||||
game.addPlayer(2,playerClient);
|
||||
|
||||
//declare pieces of client here
|
||||
pieceClient0 = new Piece(clientColor,PieceState.ACTIVE,2);
|
||||
pieceClient1 = new Piece(clientColor,PieceState.ACTIVE,3);
|
||||
pieceClient2 = new Piece(clientColor,PieceState.ACTIVE,4);
|
||||
pieceClient3 = new Piece(clientColor,PieceState.ACTIVE,5);
|
||||
pieceClient0 = new Piece(clientColor,PieceState.ACTIVE,3);
|
||||
pieceClient1 = new Piece(clientColor,PieceState.ACTIVE,4);
|
||||
pieceClient2 = new Piece(clientColor,PieceState.ACTIVE,5);
|
||||
pieceClient3 = new Piece(clientColor,PieceState.ACTIVE,6);
|
||||
|
||||
//declare player-host here
|
||||
playerHost = new Player(nameHost);
|
||||
hostColor = Color.NAVY;
|
||||
game.addPlayer(1,playerHost);
|
||||
|
||||
//declare pieces of host here
|
||||
pieceHost0 = new Piece(hostColor,PieceState.ACTIVE,6);
|
||||
pieceHost1 = new Piece(hostColor,PieceState.ACTIVE,7);
|
||||
pieceHost2 = new Piece(hostColor,PieceState.ACTIVE,8);
|
||||
pieceHost3 = new Piece(hostColor,PieceState.ACTIVE,9);
|
||||
pieceHost0 = new Piece(hostColor,PieceState.ACTIVE,7);
|
||||
pieceHost1 = new Piece(hostColor,PieceState.ACTIVE,8);
|
||||
pieceHost2 = new Piece(hostColor,PieceState.ACTIVE,9);
|
||||
pieceHost3 = new Piece(hostColor,PieceState.ACTIVE,10);
|
||||
|
||||
//set the Pieces here
|
||||
|
||||
@@ -86,133 +88,243 @@ public void broadcast(ServerMessage message) {
|
||||
|
||||
}
|
||||
|
||||
// UC-Piece-01
|
||||
@Test
|
||||
public void testMove() {
|
||||
// TODO: Implement test logic for moving a piece
|
||||
}
|
||||
|
||||
// UC-Piece-02
|
||||
/**
|
||||
* Tests the logic for when a piece can't move.
|
||||
* <p>
|
||||
* Use Case UC-Piece-02: Ensure that a piece cannot move if blocked by others.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testCantMove() {
|
||||
// TODO: Implement test logic for when a piece can't move
|
||||
}
|
||||
|
||||
// UC-Piece-03
|
||||
/**
|
||||
* Tests the logic for when no possible moves are available.
|
||||
* <p>
|
||||
* Use Case UC-Piece-03: Check game behavior when a player has no valid moves.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testNoPossibleMove() {
|
||||
// TODO: Implement test logic for when no possible moves are available
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic for throwing a piece off the board.
|
||||
* <p>
|
||||
* Use Case UC-Piece-03: Verify conditions under which a piece can be thrown off.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testThrow() {
|
||||
// TODO: Implement test logic for throwing a piece off the board
|
||||
}
|
||||
|
||||
// UC-Piece-04
|
||||
/**
|
||||
* Tests the logic for when a piece gets thrown.
|
||||
* <p>
|
||||
* Use Case UC-Piece-04: Confirm that a thrown piece is removed from play.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testGetThrown() {
|
||||
// TODO: Implement test logic for when a piece gets thrown
|
||||
}
|
||||
|
||||
// UC-Piece-05
|
||||
/**
|
||||
* Tests the logic for a piece leaving the waiting area.
|
||||
* <p>
|
||||
* Use Case UC-Piece-05: Ensure a piece can transition from waiting to active play.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testLeaveWaitingArea() {
|
||||
// TODO: Implement test logic for a piece leaving the waiting area
|
||||
}
|
||||
|
||||
// UC-Piece-06
|
||||
/**
|
||||
* Tests the logic for a piece that must leave the starting field.
|
||||
* <p>
|
||||
* Use Case UC-Piece-06: Verify conditions requiring a piece to leave its starting position.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testMustLeaveStartingField() {
|
||||
// TODO: Implement test logic for a piece that must leave the starting field
|
||||
}
|
||||
|
||||
// UC-Piece-07
|
||||
/**
|
||||
* Tests the logic for when a piece doesn't have to leave the starting field.
|
||||
* <p>
|
||||
* Use Case UC-Piece-07: Check scenarios where a piece can stay on its starting field.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testDontHaveToLeaveStartingField() {
|
||||
// TODO: Implement test logic for when a piece doesn't have to leave the starting field
|
||||
}
|
||||
|
||||
// UC-Piece-08
|
||||
/**
|
||||
* Tests the logic for when a piece can't leave the starting field.
|
||||
* <p>
|
||||
* Use Case UC-Piece-08: Verify conditions preventing a piece from leaving its starting field.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testCantLeaveStartingField() {
|
||||
// TODO: Implement test logic for when a piece can't leave the starting field
|
||||
}
|
||||
|
||||
// UC-Piece-09
|
||||
/**
|
||||
* Tests the logic for when a piece reaches a bonus field.
|
||||
* <p>
|
||||
* Use Case UC-Piece-09: Verify the benefits applied when landing on a bonus field.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testReachBonusField() {
|
||||
// TODO: Implement test logic for when a piece reaches a bonus field
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic for when there are no power cards available.
|
||||
* <p>
|
||||
* Use Case UC-Piece-09: Ensure the game handles the situation with no available power cards.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testNoPowerCards() {
|
||||
// TODO: Implement test logic for when there are no power cards available
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic for shuffling the pile of power cards.
|
||||
* <p>
|
||||
* Use Case UC-Piece-09: Confirm that the power card deck can be shuffled correctly.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testShufflePile() {
|
||||
// TODO: Implement test logic for shuffling the pile of power cards
|
||||
}
|
||||
|
||||
// UC-Piece-10
|
||||
/**
|
||||
* Tests the logic for entering the house area.
|
||||
* <p>
|
||||
* Use Case UC-Piece-10: Verify that a piece can enter the house area according to the rules.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testEnterHouse() {
|
||||
// TODO: Implement test logic for entering the house area
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to ensure a piece can only enter its own house.
|
||||
* <p>
|
||||
* Use Case UC-Piece-10: Check that a piece can only enter its designated house.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testOnlyEnterOwnHouse() {
|
||||
// TODO: Implement test logic to ensure a piece can only enter its own house
|
||||
}
|
||||
|
||||
// UC-Piece-11
|
||||
/**
|
||||
* Tests the logic for activating a piece in the home area.
|
||||
* <p>
|
||||
* Use Case UC-Piece-11: Confirm that a piece can be activated correctly in the home area.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testActiveHomePiece() {
|
||||
// TODO: Implement test logic for activating a piece in the home area
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to prevent jumping over another piece in the house.
|
||||
* <p>
|
||||
* Use Case UC-Piece-11: Ensure that a piece cannot jump over another piece in the house area.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testCantJumpOverFigureInHouse() {
|
||||
// TODO: Implement test logic to prevent jumping over another piece in the house
|
||||
}
|
||||
|
||||
// UC-Piece-12
|
||||
/**
|
||||
* Tests the logic for when an active home piece is blocked.
|
||||
* <p>
|
||||
* Use Case UC-Piece-12: Verify that an active piece cannot move if blocked by another piece.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testActiveHomePieceBlocked() {
|
||||
// TODO: Implement test logic for when an active home piece is blocked
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic for a piece on the starting field with a shield.
|
||||
* <p>
|
||||
* Use Case UC-Piece-13: Ensure that a piece with a shield behaves correctly on the starting field.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testOnStartingFieldWithShield() {
|
||||
// TODO: Implement test logic for a piece on the starting field with a shield
|
||||
}
|
||||
|
||||
// UC-Piece-13
|
||||
/**
|
||||
* Tests the logic for attempting to throw a figure with a shield.
|
||||
* <p>
|
||||
* Use Case UC-Piece-14: Verify that a piece with a shield cannot be thrown by opponents.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testThrowFigureWithShield() {
|
||||
// TODO: Implement test logic for attempting to throw a figure with a shield
|
||||
}
|
||||
|
||||
// UC-Piece-14
|
||||
/**
|
||||
* Tests the logic for using a swap power-up.
|
||||
* <p>
|
||||
* Use Case UC-Piece-15: Confirm that a player can use a swap power-up to exchange positions.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testUseSwap() {
|
||||
// TODO: Implement test logic for using a swap power-up
|
||||
}
|
||||
|
||||
// UC-Piece-15
|
||||
/**
|
||||
* Tests the logic for using a shield power-up.
|
||||
* <p>
|
||||
* Use Case UC-Piece-16: Ensure that a player can activate a shield power-up correctly.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testUseShield() {
|
||||
// TODO: Implement test logic for using a shield power-up
|
||||
}
|
||||
|
||||
// UC-Piece-16
|
||||
/**
|
||||
* Tests the logic for when a piece loses its shield.
|
||||
* <p>
|
||||
* Use Case UC-Piece-17: Verify that the game correctly updates the status when a piece loses its shield.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testLoseShield() {
|
||||
// TODO: Implement test logic for when a piece loses its shield
|
||||
}
|
||||
|
||||
// UC-Piece-17
|
||||
/**
|
||||
* Tests the logic for a piece that has finished the game.
|
||||
* <p>
|
||||
* Use Case UC-Piece-18: Confirm that the game recognizes a piece that has completed its journey.
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testFinishedPiece() {
|
||||
// TODO: Implement test logic for a piece that has finished the game
|
||||
|
||||
Reference in New Issue
Block a user