Add basic test for Block

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-12-18 16:56:07 +01:00
parent 41a52c993e
commit 3f46176bf1

View File

@ -0,0 +1,24 @@
package instance;
import net.minestom.server.instance.block.Block;
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
import org.jglrxavpok.hephaistos.nbt.NBTInt;
import org.junit.jupiter.api.Test;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class BlockTest {
@Test
public void testEquality() {
var nbt = new NBTCompound(Map.of("key", new NBTInt(5)));
Block b1 = Block.CHEST;
Block b2 = Block.CHEST;
assertEquals(b1.withNbt(nbt), b2.withNbt(nbt));
assertEquals(b1.withProperty("facing", "north").getProperty("facing"), "north");
assertEquals(b1.withProperty("facing", "north"), b2.withProperty("facing", "north"));
}
}