Skip to content

Commit 35b5dcb

Browse files
committed
Add integration the for the custom player implementation
1 parent 8fb5892 commit 35b5dcb

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package net.minestom.testing;
2+
3+
import net.minestom.server.coordinate.Pos;
4+
import net.minestom.server.entity.Player;
5+
import net.minestom.server.instance.Instance;
6+
import net.minestom.testing.extension.MicrotusExtension;
7+
import org.jetbrains.annotations.NotNull;
8+
import org.junit.jupiter.api.Test;
9+
import org.junit.jupiter.api.extension.ExtendWith;
10+
11+
import static org.junit.jupiter.api.Assertions.*;
12+
13+
@ExtendWith(MicrotusExtension.class)
14+
class TestPlayerIntegrationTest {
15+
16+
@Test
17+
void testCustomPlayerCreation(@NotNull Env env) {
18+
Instance instance = env.createFlatInstance();
19+
assertNotNull(instance);
20+
Player player = env.createPlayer(instance);
21+
assertNotNull(player, "Player should not be null after creation");
22+
assertInstanceOf(Player.class, player, "Player should be an instance of Player class");
23+
assertInstanceOf(TestPlayerImpl.class, player, "Player should be an instance of TestPlayerImpl class");
24+
assertEquals(instance, player.getInstance(), "Player should be in the created instance");
25+
assertEquals(Pos.ZERO, player.getPosition(), "Player should start at position (0, 0, 0)");
26+
assertEquals("RandName", player.getUsername(), "Player should have a random name");
27+
}
28+
29+
}

0 commit comments

Comments
 (0)