Commit 11a5dcf6 authored by Toussaint Etienne's avatar Toussaint Etienne

Fix Junit term

parent 8f78310b
......@@ -6,6 +6,7 @@ package graphics.display_test;
import artificial_intelligence.AIControler;
import artificial_intelligence.AIEntities.AgressiveEntity;
import artificial_intelligence.AIEntities.EnumBehaviourType;
import com.sun.javafx.scene.traversal.Direction;
import gameloop.DummyLocalGameLoop;
import gameloop.GameStarter;
import graphics.graphical_abstraction.GraphicsMasterAbstraction;
......@@ -25,20 +26,20 @@ public class GamePanelTermTest {
public void test_move() {
GraphicsMasterTerm.build();
GraphicsMasterAbstraction gm = GraphicsMasterAbstraction.getInstance();
gm.launchGUI();
Thread runable = new Thread(new Runnable(){
@Override
public void run() {
gm.launchGUI();
}
});
runable.start();
GameStarter.startGameSinglePlayer();
//gm.keyPressedHandler(Input.ATTACK);
gm.changeGUIStateTo(GraphicsMasterAbstraction.GUIStates.GAME_PANEL);
int x = DummyLocalGameLoop.getInstance().getFollowedRelayer().getCharacter().getX();
int y = DummyLocalGameLoop.getInstance().getFollowedRelayer().getCharacter().getY();
gm.keyPressedHandler(Input.LEFT_ARROW);
gm.keyPressedHandler(Input.UP_ARROW);
/*Wait for the event to be process*/
try {
Thread.currentThread().sleep(100);
} catch (InterruptedException e) {
//e.printStackTrace();
}
assertEquals(x,DummyLocalGameLoop.getInstance().getFollowedRelayer().getCharacter().getX()-DummyLocalGameLoop.getInstance().getFollowedRelayer().getCharacter().getSpeed());
assertEquals(x,DummyLocalGameLoop.getInstance().getFollowedRelayer().getCharacter().getY()+DummyLocalGameLoop.getInstance().getFollowedRelayer().getCharacter().getSpeed());
assertEquals(DummyLocalGameLoop.getInstance().getFollowedRelayer().getDirection(), core.zone.Direction.LEFTUP);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment