merge tests into development #25
@@ -2,14 +2,87 @@
|
|||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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
|
* this test-class tests the testcases T035-T058
|
||||||
*/
|
*/
|
||||||
public class PieceTest {
|
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
|
@Before
|
||||||
public void Setup() {
|
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;
|
||||||
|
|
||||||
|
//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);
|
||||||
|
|
||||||
|
//declare player-host here
|
||||||
|
playerHost = new Player(nameHost);
|
||||||
|
hostColor = Color.NAVY;
|
||||||
|
|
||||||
|
//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);
|
||||||
|
|
||||||
|
//set the Pieces here
|
||||||
|
|
||||||
|
|
||||||
|
//declare messages here
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ public void broadcast(ServerMessage message) {
|
|||||||
playerClientColor = Color.ARMY;
|
playerClientColor = Color.ARMY;
|
||||||
playerClient.setColor(playerClientColor);
|
playerClient.setColor(playerClientColor);
|
||||||
playerClient.addHandCards(bonusCardClient);
|
playerClient.addHandCards(bonusCardClient);
|
||||||
game.addPlayer(IDPlayerClient,playerClient);
|
game.addPlayer(IDPlayerClient,playerClient); //TODO random uuid
|
||||||
|
|
||||||
//initialize a piece for client
|
//initialize a piece for client
|
||||||
IDPiece = 3;
|
IDPiece = 3;
|
||||||
|
|||||||
Reference in New Issue
Block a user