diff options
author | Adam NAILI | 2018-02-01 22:07:24 +0100 |
---|---|---|
committer | Adam NAILI | 2018-02-01 22:07:24 +0100 |
commit | 3a147161307dd8189243fba8d1c2283a6bba1122 (patch) | |
tree | 23a3f1b4d466bdcb9c321490c428f0fe0264672c /src/test/java/fr | |
parent | 6dd0e213ba1f82941c7cc5f41f72aea29fb257a7 (diff) | |
download | wallj-3a147161307dd8189243fba8d1c2283a6bba1122.tar.gz |
Clearing TODOs
Diffstat (limited to 'src/test/java/fr')
-rw-r--r-- | src/test/java/fr/umlv/java/wallj/controller/DisplayControllerTest.java | 44 |
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 @@ | |||
1 | package fr.umlv.java.wallj.controller; | ||
2 | |||
3 | import fr.umlv.java.wallj.board.Board; | ||
4 | import fr.umlv.java.wallj.board.TileVec2; | ||
5 | import fr.umlv.java.wallj.context.Context; | ||
6 | import fr.umlv.java.wallj.context.Game; | ||
7 | import fr.umlv.java.wallj.context.ScreenManager; | ||
8 | import fr.umlv.java.wallj.block.Block; | ||
9 | import fr.umlv.java.wallj.block.BlockFactory; | ||
10 | import fr.umlv.java.wallj.block.BlockType; | ||
11 | import fr.umlv.zen5.Application; | ||
12 | import org.junit.jupiter.api.Test; | ||
13 | |||
14 | import java.awt.*; | ||
15 | import java.util.Collections; | ||
16 | import java.util.LinkedList; | ||
17 | |||
18 | public 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 | } | ||