aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/fr
diff options
context:
space:
mode:
authorAdam NAILI2018-02-01 22:07:24 +0100
committerAdam NAILI2018-02-01 22:07:24 +0100
commit3a147161307dd8189243fba8d1c2283a6bba1122 (patch)
tree23a3f1b4d466bdcb9c321490c428f0fe0264672c /src/test/java/fr
parent6dd0e213ba1f82941c7cc5f41f72aea29fb257a7 (diff)
downloadwallj-3a147161307dd8189243fba8d1c2283a6bba1122.tar.gz
Clearing TODOs
Diffstat (limited to 'src/test/java/fr')
-rw-r--r--src/test/java/fr/umlv/java/wallj/controller/DisplayControllerTest.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/test/java/fr/umlv/java/wallj/controller/DisplayControllerTest.java b/src/test/java/fr/umlv/java/wallj/controller/DisplayControllerTest.java
new file mode 100644
index 0000000..bcd4de9
--- /dev/null
+++ b/src/test/java/fr/umlv/java/wallj/controller/DisplayControllerTest.java
@@ -0,0 +1,44 @@
1package fr.umlv.java.wallj.controller;
2
3import fr.umlv.java.wallj.board.Board;
4import fr.umlv.java.wallj.board.TileVec2;
5import fr.umlv.java.wallj.context.Context;
6import fr.umlv.java.wallj.context.Game;
7import fr.umlv.java.wallj.context.ScreenManager;
8import fr.umlv.java.wallj.block.Block;
9import fr.umlv.java.wallj.block.BlockFactory;
10import fr.umlv.java.wallj.block.BlockType;
11import fr.umlv.zen5.Application;
12import org.junit.jupiter.api.Test;
13
14import java.awt.*;
15import java.util.Collections;
16import java.util.LinkedList;
17
18public class DisplayControllerTest {
19 @Test
20 void TestDisplay() throws java.lang.InterruptedException {
21
22 Application.run(Color.WHITE, applicationContext -> {
23 for (; ; ) {
24 applicationContext.renderFrame(graphics2D -> {
25 Board.Builder builder = new Board.Builder(51, 51);
26 TileVec2 t0 = TileVec2.of(50, 50);
27 builder.setBlockTypeAt(t0, BlockType.WALL);
28 LinkedList<Board> boards = new LinkedList<>();
29 boards.add(builder.build());
30 Game game = new Game(boards);
31 ScreenManager screenManager = new ScreenManager(applicationContext, graphics2D);
32 try {
33 Thread.sleep(50);
34 } catch (Exception e) {
35 System.exit(-1);
36 }
37 Context context = new Context(game, Collections.emptyList(), screenManager.clearScreen());
38 Block block = BlockFactory.build(BlockType.BOMB, t0);
39 block.update(context);
40 });
41 }
42 });
43 }
44}