Add unit test

This commit is contained in:
nucker 2023-01-11 18:14:37 +00:00
parent ff7c4c108f
commit 68500bf0d0
1 changed files with 19 additions and 0 deletions

View File

@ -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));
}
}