merge tests into development #25
File diff suppressed because it is too large
Load Diff
@@ -2,144 +2,355 @@
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import pp.mdga.message.server.ServerMessage;
|
||||
import pp.mdga.server.ServerGameLogic;
|
||||
import pp.mdga.server.ServerSender;
|
||||
|
||||
/**
|
||||
* this test-class tests the testcases T035-T058
|
||||
*/
|
||||
public class PieceTest {
|
||||
|
||||
//declare game here
|
||||
private Game game;
|
||||
|
||||
//declare server here
|
||||
private ServerGameLogic serverGameLogic;
|
||||
|
||||
//declare player-Client here
|
||||
private Player playerClient;
|
||||
private String nameClient = "Client";
|
||||
private Color clientColor;
|
||||
|
||||
//declare pieces of client here
|
||||
private Piece pieceClient0;
|
||||
private Piece pieceClient1;
|
||||
private Piece pieceClient2;
|
||||
private Piece pieceClient3;
|
||||
|
||||
//declare player-host here
|
||||
private Player playerHost;
|
||||
private String nameHost = "Host";
|
||||
private Color hostColor;
|
||||
|
||||
//declare pieces of host here
|
||||
private Piece pieceHost0;
|
||||
private Piece pieceHost1;
|
||||
private Piece pieceHost2;
|
||||
private Piece pieceHost3;
|
||||
|
||||
//declare messages here
|
||||
|
||||
@Before
|
||||
public void Setup() {
|
||||
//initialize game here
|
||||
game = new Game();
|
||||
|
||||
//initialize server here
|
||||
serverGameLogic = new ServerGameLogic(new ServerSender() {
|
||||
@Override
|
||||
public void send(int id, ServerMessage message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void broadcast(ServerMessage message) {
|
||||
|
||||
}
|
||||
},game);
|
||||
|
||||
//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,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,7);
|
||||
pieceHost1 = new Piece(hostColor,PieceState.ACTIVE,8);
|
||||
pieceHost2 = new Piece(hostColor,PieceState.ACTIVE,9);
|
||||
pieceHost3 = new Piece(hostColor,PieceState.ACTIVE,10);
|
||||
|
||||
//set the Client-pieces here
|
||||
game.getBoard().setPieceOnBoard(25,pieceClient0); //for UC 02, 03.01, 14,4
|
||||
game.getBoard().setPieceOnBoard(); //TODo set piece in Home at 2 slot for UC 18,12,13,11
|
||||
game.getBoard().setPieceOnBoard(19,pieceClient2); //for UC 13, 15
|
||||
game.getBoard().setPieceOnBoard();
|
||||
|
||||
//set the host-pieces here
|
||||
game.getBoard().setPieceOnBoard(28,pieceHost0); //for UC 02,14 ,15, 03.01,4
|
||||
game.getBoard().setPieceOnBoard(18,pieceHost1); //for UC 1, 10, 17, 16
|
||||
game.getBoard().setPieceOnBoard();//Todo set in home fur uc 5
|
||||
game.getBoard().setPieceOnBoard(0,pieceHost3); //for uc 9
|
||||
|
||||
|
||||
//declare messages here
|
||||
|
||||
//send the serverGameTurn
|
||||
|
||||
//set the active color
|
||||
game.setActiveColor(clientColor);
|
||||
|
||||
}
|
||||
|
||||
// UC-Piece-01
|
||||
/**
|
||||
* Tests the logic for when a piece moves.
|
||||
* <p>
|
||||
* Use Case UC-Piece-01: Ensure that a piece moves in the right direction
|
||||
* </p>
|
||||
*/
|
||||
@Test
|
||||
public void testMove() {
|
||||
// TODO: Implement test logic for moving a piece
|
||||
// TODO: Implement test logic for when a piece can't move
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user