Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
11a5dcf6
Commit
11a5dcf6
authored
Jan 06, 2016
by
Toussaint Etienne
Browse files
Fix Junit term
parent
8f78310b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graphics/display_test/GamePanelTermTest.java
View file @
11a5dcf6
...
...
@@ -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
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment