Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jxlle committed Mar 15, 2020
1 parent 176d222 commit 9a08aa9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/test/java/GUI/Panel/GameWorldPanelTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package GUI.Panel;

import Controllers.GUItoSystemInterface;
import Controllers.ProgramController;
import System.GameWorld.Level.LevelLoader;
import System.Logic.ProgramArea.PABlockHandler;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -20,7 +22,9 @@ void setUp() {
cornerY = 8;
width = 500;
height = 800;
controller = new ProgramController();
PABlockHandler blockHandler = new PABlockHandler();
GUItoSystemInterface converter = new GUItoSystemInterface(blockHandler);
controller = new ProgramController(converter, blockHandler);
LevelLoader loader = new LevelLoader();
loader.loadLevel();
panel = new GameWorldPanel(cornerX, cornerY, width, height, controller);
Expand Down
6 changes: 5 additions & 1 deletion src/test/java/GUI/Panel/PalettePanelTest.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package GUI.Panel;

import Controllers.GUItoSystemInterface;
import Controllers.ProgramController;
import GUI.Blocks.GUIBlock;
import GUI.Blocks.GUICavityBlock;
import System.GameState.GameState;
import System.GameWorld.Level.LevelLoader;
import System.Logic.ProgramArea.PABlockHandler;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -23,7 +25,9 @@ void setUp() {
cornerY = 8;
width = 500;
height = 800;
controller = new ProgramController();
PABlockHandler blockHandler = new PABlockHandler();
GUItoSystemInterface converter = new GUItoSystemInterface(blockHandler);
controller = new ProgramController(converter, blockHandler);
LevelLoader loader = new LevelLoader();
loader.loadLevel();
panel = new PalettePanel(cornerX, cornerY, width, height, controller);
Expand Down
10 changes: 8 additions & 2 deletions src/test/java/GUI/Panel/ProgramAreaPanelTest.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package GUI.Panel;

import Controllers.ConnectionController;
import Controllers.GUItoSystemInterface;
import Controllers.ProgramController;
import GUI.Blocks.Factories.GUIFactory;
import GUI.Blocks.Factories.MoveForwardGUIFactory;
import GUI.Blocks.GUIBlock;
import System.GameWorld.Level.LevelLoader;
import System.Logic.ProgramArea.PABlockHandler;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -26,10 +29,13 @@ void setUp() {
cornerY = 8;
width = 500;
height = 800;
controller = new ProgramController();
PABlockHandler blockHandler = new PABlockHandler();
GUItoSystemInterface converter = new GUItoSystemInterface(blockHandler);
controller = new ProgramController(converter, blockHandler);
ConnectionController connectionController = new ConnectionController(converter, blockHandler);
LevelLoader loader = new LevelLoader();
loader.loadLevel();
panel = new ProgramAreaPanel(cornerX, cornerY, width, height, controller);
panel = new ProgramAreaPanel(cornerX, cornerY, width, height, controller, connectionController);
GUIFactory f = new MoveForwardGUIFactory();
block = f.createBlock("id", 0, 0);
panel.addBlockToProgramArea(block);
Expand Down

0 comments on commit 9a08aa9

Please sign in to comment.