aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2024-02-04 12:49:53 -0500
committerGitHub <noreply@github.com>2024-02-04 12:49:53 -0500
commitfe1bc0589caef8ff9f2d616a3742e63e2668f00e (patch)
tree06e8e1b2ee3e3a9381dc042650f4fe6ac86582c5 /src/test/java
parentce90376c4a8a934cc4d2f8bc4dd0e5e1c71b3748 (diff)
parent71467890a61eb4e05793b1856f6303787216f2ec (diff)
downloadSkyblocker-fe1bc0589caef8ff9f2d616a3742e63e2668f00e.tar.gz
Skyblocker-fe1bc0589caef8ff9f2d616a3742e63e2668f00e.tar.bz2
Skyblocker-fe1bc0589caef8ff9f2d616a3742e63e2668f00e.zip
Merge pull request #523 from olim88/crystal-hollows-fetures
Crystal hollows fetures
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHudTest.java19
-rw-r--r--src/test/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationManagerTest.java32
2 files changed, 51 insertions, 0 deletions
diff --git a/src/test/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHudTest.java b/src/test/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHudTest.java
new file mode 100644
index 00000000..2a3afe9c
--- /dev/null
+++ b/src/test/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHudTest.java
@@ -0,0 +1,19 @@
+package de.hysky.skyblocker.skyblock.dwarven;
+
+import org.joml.Vector2i;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class CrystalsHudTest {
+
+ @Test
+ void testLocationTransformation() {
+ Assertions.assertEquals(CrystalsHud.transformLocation(202, 202), new Vector2i(0, 0));
+ Assertions.assertEquals(CrystalsHud.transformLocation(823, 823), new Vector2i(62, 62));
+
+ Assertions.assertEquals(CrystalsHud.transformLocation(512.5, 512.5), new Vector2i(31, 31));
+
+ Assertions.assertEquals(CrystalsHud.transformLocation(-50, -50), new Vector2i(0, 0));
+ Assertions.assertEquals(CrystalsHud.transformLocation(1000, 1000), new Vector2i(62, 62));
+ }
+}
diff --git a/src/test/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationManagerTest.java b/src/test/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationManagerTest.java
new file mode 100644
index 00000000..4ce61880
--- /dev/null
+++ b/src/test/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationManagerTest.java
@@ -0,0 +1,32 @@
+package de.hysky.skyblocker.skyblock.dwarven;
+
+import net.minecraft.util.math.BlockPos;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import de.hysky.skyblocker.utils.Constants;
+
+public class CrystalsLocationManagerTest {
+
+ @Test
+ void testLocationInCrystals() {
+ Assertions.assertTrue(CrystalsLocationsManager.checkInCrystals(new BlockPos(512, 70, 512)));
+
+ Assertions.assertTrue(CrystalsLocationsManager.checkInCrystals(new BlockPos(202, 31, 202)));
+ Assertions.assertTrue(CrystalsLocationsManager.checkInCrystals(new BlockPos(823, 188, 823)));
+
+ Assertions.assertFalse(CrystalsLocationsManager.checkInCrystals(new BlockPos(201, 31, 202)));
+ Assertions.assertFalse(CrystalsLocationsManager.checkInCrystals(new BlockPos(202, 30, 202)));
+ Assertions.assertFalse(CrystalsLocationsManager.checkInCrystals(new BlockPos(202, 31, 201)));
+
+ Assertions.assertFalse(CrystalsLocationsManager.checkInCrystals(new BlockPos(824, 188, 823)));
+ Assertions.assertFalse(CrystalsLocationsManager.checkInCrystals(new BlockPos(823, 189, 823)));
+ Assertions.assertFalse(CrystalsLocationsManager.checkInCrystals(new BlockPos(823, 188, 824)));
+ }
+
+ @Test
+ void testSetLocationMessage() {
+ Assertions.assertEquals(CrystalsLocationsManager.getSetLocationMessage("Jungle Temple", new BlockPos(10, 11, 12)).getString(), Constants.PREFIX.get().getString() + "Added waypoint for Jungle Temple at : 10 11 12.");
+ Assertions.assertEquals(CrystalsLocationsManager.getSetLocationMessage("Fairy Grotto", new BlockPos(0, 0, 0)).getString(), Constants.PREFIX.get().getString() + "Added waypoint for Fairy Grotto at : 0 0 0.");
+ }
+}