From 68500bf0d0fe331a8bdbba8c7063c7f3ecdc313d Mon Sep 17 00:00:00 2001 From: nucker Date: Wed, 11 Jan 2023 18:14:37 +0000 Subject: [PATCH] Add unit test --- .../server/instance/BlockPlaceTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/java/net/minestom/server/instance/BlockPlaceTest.java diff --git a/src/test/java/net/minestom/server/instance/BlockPlaceTest.java b/src/test/java/net/minestom/server/instance/BlockPlaceTest.java new file mode 100644 index 000000000..01dfa9848 --- /dev/null +++ b/src/test/java/net/minestom/server/instance/BlockPlaceTest.java @@ -0,0 +1,19 @@ +package net.minestom.server.instance; + +import net.minestom.server.instance.block.Block; +import net.minestom.testing.Env; +import net.minestom.testing.EnvTest; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + +@EnvTest +public class BlockPlaceTest { + + @Test + void testPlacementOutOfLimit(Env env) { + Instance instance = env.createFlatInstance(); + assertDoesNotThrow(() -> instance.setBlock(0, instance.getDimensionType().getMaxY() + 1, 0, Block.STONE)); + assertDoesNotThrow(() -> instance.setBlock(0, instance.getDimensionType().getMinY() - 1, 0, Block.STONE)); + } +}