package school_project;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

class MapTest {

    @Test
    void getUsedSpace() {
        boolean[][] map_matrix = {
                {false, true, true, false},
                {false, true, true, true},
                {true, true, true, false},
                {false, true, true, true}
        };
        Map testMap = new Map(map_matrix);

        boolean[][] piece1_matrix = {
                {true, true},
                {true, true},
        };
        Piece piece1 = new Piece(piece1_matrix);
        testMap.addPiece(piece1);
        piece1.setPosition(new Vec2(0,1));

        boolean[][] result_matrix = {
                {false, false, false, false},
                {false, false, false, true},
                {true, true, true, false},
                {false, true, true, true}
        };
        assertArrayEquals(result_matrix, testMap.getUsedSpace());
    }
}