-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestPlayerIntegrationTest.java
More file actions
29 lines (24 loc) · 1.22 KB
/
TestPlayerIntegrationTest.java
File metadata and controls
29 lines (24 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package net.minestom.testing;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.entity.Player;
import net.minestom.server.instance.Instance;
import net.minestom.testing.extension.MicrotusExtension;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import static org.junit.jupiter.api.Assertions.*;
@ExtendWith(MicrotusExtension.class)
class TestPlayerIntegrationTest {
@Test
void testCustomPlayerCreation(@NotNull Env env) {
Instance instance = env.createFlatInstance();
assertNotNull(instance);
Player player = env.createPlayer(instance);
assertNotNull(player, "Player should not be null after creation");
assertInstanceOf(Player.class, player, "Player should be an instance of Player class");
assertInstanceOf(TestPlayerImpl.class, player, "Player should be an instance of TestPlayerImpl class");
assertEquals(instance, player.getInstance(), "Player should be in the created instance");
assertEquals(Pos.ZERO, player.getPosition(), "Player should start at position (0, 0, 0)");
assertEquals("RandName", player.getUsername(), "Player should have a random name");
}
}