remove board from constructor

This commit is contained in:
2025-04-16 19:29:31 +02:00
parent bee5e613bb
commit 17ef882d44
5 changed files with 13 additions and 21 deletions

View File

@@ -3,24 +3,20 @@
*/
package chess;
import org.junit.jupiter.api.Test;
import chess.ai.DumbAI;
import chess.controller.Command;
import chess.controller.CommandExecutor;
import chess.controller.commands.NewGameCommand;
import chess.controller.commands.UndoCommand;
import chess.controller.event.GameAdaptator;
import chess.model.*;
import chess.model.pieces.*;
import chess.simulator.Simulator;
import chess.view.simplerender.Window;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Objects;
import chess.model.Color;
import chess.model.Game;
class AppTest {
@Test void functionalRollback(){
Game game = new Game(new ChessBoard());
Game game = new Game();
CommandExecutor commandExecutor = new CommandExecutor(game);
DumbAI ai = new DumbAI(commandExecutor, Color.Black);
@@ -38,9 +34,9 @@ class AppTest {
result = commandExecutor.executeCommand(new UndoCommand());
} while (result != Command.CommandResult.NotAllowed);
Game initialGame = new Game(new ChessBoard());
Game initialGame = new Game();
CommandExecutor initialCommandExecutor = new CommandExecutor(initialGame);
commandExecutor.executeCommand(new NewGameCommand());
initialCommandExecutor.executeCommand(new NewGameCommand());
assert(game.getBoard().equals(initialGame.getBoard()));