Java_Chess

.idea
    .name 5 B
    artifacts
       Chess_jar.xml 371 B
    compiler.xml 734 B
    copyright
    description.html 97 B
    encodings.xml 171 B
    libraries
       jansi_1_11.xml 214 B
    misc.xml 5 KB
    modules.xml 261 B
    project-template.xml 91 B
    scopes
       scope_settings.xml 143 B
    uiDesigner.xml 8 KB
    vcs.xml 176 B
    workspace.xml 61 KB
Chess.iml 1 KB
Doxyfile 101 KB
GUI_Manual_Testplan.pdf 437 KB
Graphics
    blackBerolinaPawn.png 1 KB
    blackBishop.png 5 KB
    blackKing.png 8 KB
    blackKnight.png 6 KB
    blackPawn.png 2 KB
    blackQueen.png 8 KB
    blackRook.png 3 KB
    blackWazir.png 1 KB
    whiteBerolinaPawn.png 2 KB
    whiteBishop.png 7 KB
    whiteKing.png 8 KB
    whiteKnight.png 7 KB
    whitePawn.png 4 KB
    whiteQueen.png 10 KB
    whiteRook.png 4 KB
    whiteWazir.png 2 KB
README 342 B
jansi-1.11.jar 111 KB
src
    CHANGES 1001 B
    GUI
       Controller.java 15 KB
       Main.java 360 B
       View.java 14 KB
       textPanel.java 776 B
    Game
       Board.java 5 KB
       CLI.java 5 KB
       Command.java 1022 B
       GameManager.java 11 KB
       GameType.java 74 B
       MoveHandler.java 1 KB
       Player.java 133 B
    META-INF
       MANIFEST.MF 53 B
    Main.java 154 B
    Pieces
       BerolinaPawn.java 1 KB
       Bishop.java 480 B
       BoardSquare.java 4 KB
       King.java 470 B
       Knight.java 846 B
       MoveType.java 530 B
       Pawn.java 1 KB
       Queen.java 474 B
       Rook.java 471 B
       Wazir.java 627 B
    TODO 176 B
    Tests
       BoardTest.java 2 KB
       GameManagerTest.java 21 KB
BoardTest.java
package Tests;

import Game.*;
import Pieces.BoardSquare;
import Pieces.King;
import org.junit.Test;

import static org.junit.Assert.assertEquals;


public class BoardTest {

    @Test
    public void testGetPiece() throws Exception {
        Board gameBoard = new Board(8, 8, GameType.STANDARD);
        boolean playerTurn;//true for 1, false for 2

        System.out.println("Setting up new game.\n");
        playerTurn = true;
        //gameBoard.SetPieces();

        BoardSquare piece = gameBoard.getPiece(0, 0);

        assertEquals(piece.owner, 1);
        //assertEquals(piece.getType(), PieceType.ROOK);
        assertEquals(piece.hasMoved, false);
    }

    @Test
    public void testGetPiece_OutOfBounds() throws Exception {
        Board gameBoard = new Board(8, 8, GameType.STANDARD);
        boolean playerTurn;//true for 1, false for 2

        System.out.println("Setting up new game.\n");
        playerTurn = true;
        //gameBoard.SetPieces();

        BoardSquare piece = gameBoard.getPiece(88, -120);

        assertEquals(piece, null);
    }

    @Test
    public void testSetPiece() throws Exception {
        Board gameBoard = new Board(8, 8, GameType.STANDARD);
        boolean playerTurn;//true for 1, false for 2

        System.out.println("Setting up new game.\n");
        playerTurn = true;
        //gameBoard.SetPieces();

        gameBoard.setPiece(0, 0, new King(0, 0, Player.BLACK), Player.BLACK);

        BoardSquare piece = gameBoard.getPiece(0, 0);

        assertEquals(piece.owner, 2);
        //assertEquals(piece.getType(), PieceType.KING);
        assertEquals(piece.hasMoved, true);


    }

    @Test
    public void testSetPiece_OutOfBounds() throws Exception {
        Board gameBoard = new Board(8, 8, GameType.STANDARD);
        boolean playerTurn;//true for 1, false for 2

        System.out.println("Setting up new game.\n");
        playerTurn = true;
        //gameBoard.SetPieces();

        gameBoard.setPiece(-40, 55, new King(0, 0, Player.BLACK), Player.BLACK);

        BoardSquare piece = gameBoard.getPiece(-40, 55);

        assertEquals(piece, null);


    }

    @Test
    public void testSetBlank_OutOfBounds() throws Exception {

        Board gameBoard = new Board(8, 8, GameType.STANDARD);
        boolean playerTurn;//true for 1, false for 2

        System.out.println("Setting up new game.\n");
        playerTurn = true;
        //gameBoard.SetPieces();

        gameBoard.setBlank(-40, 55);

        BoardSquare piece = gameBoard.getPiece(-40, 55);

        assertEquals(piece, null);

    }
}