forked from Minestom/Minestom
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23b0e21
commit 925a6e0
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/test/java/net/minestom/server/coordinate/PointTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package net.minestom.server.coordinate; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class PointTest { | ||
|
||
@Test | ||
void testPosCenter2D() { | ||
Pos pos = new Pos(1, 100, 10); | ||
assertNotNull(pos); | ||
|
||
Point centered = pos.center2D(); | ||
assertInstanceOf(Pos.class, centered); | ||
|
||
assertNotNull(centered); | ||
assertNotEquals(pos, centered); | ||
assertEquals(1.5, centered.x()); | ||
assertEquals(10.5, centered.z()); | ||
} | ||
|
||
@Test | ||
void testVecCenter3D() { | ||
Point centered3D = Vec.ZERO.center3D(); | ||
assertInstanceOf(Vec.class, centered3D); | ||
assertEquals(0.5, centered3D.x()); | ||
assertEquals(0.5, centered3D.y()); | ||
assertEquals(0.5, centered3D.z()); | ||
} | ||
} |