BlueGit

timfa chestpreviews

Files

chestpreviews / src / test / java / nl / timfalken / chestpreview / BlockKeyTest.java

BlockKeyTest.java

BlockKeyTest.java 843 B Download Raw
1package nl.timfalken.chestpreview;
2
3import java.util.UUID;
4
5import org.junit.jupiter.api.Test;
6
7import static org.junit.jupiter.api.Assertions.assertEquals;
8import static org.junit.jupiter.api.Assertions.assertTrue;
9
10class BlockKeyTest {
11
12 @Test
13 void compareToOrdersByWorldThenCoordinates() {
14 UUID a = UUID.fromString("00000000-0000-0000-0000-000000000001");
15 UUID b = UUID.fromString("00000000-0000-0000-0000-000000000002");
16 BlockKey origin = new BlockKey(a, 0, 64, 0);
17 BlockKey higher = new BlockKey(a, 0, 65, 0);
18 BlockKey otherWorld = new BlockKey(b, 0, 64, 0);
19 assertEquals(0, origin.compareTo(new BlockKey(a, 0, 64, 0)));
20 assertTrue(origin.compareTo(higher) < 0);
21 assertTrue(higher.compareTo(origin) > 0);
22 assertTrue(origin.compareTo(otherWorld) < 0);
23 }
24}