Skip to content

Commit

Permalink
Add new test class
Browse files Browse the repository at this point in the history
  • Loading branch information
theEvilReaper committed Dec 10, 2024
1 parent 23b0e21 commit 925a6e0
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/test/java/net/minestom/server/coordinate/PointTest.java
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());
}
}

0 comments on commit 925a6e0

Please sign in to comment.