use of be.seeseemelk.mockbukkit.entity.PlayerMock in project IridiumSkyblock by Iridium-Development.
the class CreateCommandTest method executeWithName.
@Test
public void executeWithName() {
PlayerMock playerMock = new UserBuilder(serverMock).buildPlayer();
serverMock.dispatchCommand(playerMock, "is create IslandName");
assertTrue(playerMock.getOpenInventory().getTopInventory().getHolder() instanceof IslandCreateGUI);
IslandCreateGUI islandCreateGUI = (IslandCreateGUI) playerMock.getOpenInventory().getTopInventory().getHolder();
assertEquals("IslandName", islandCreateGUI.getIslandName());
}
use of be.seeseemelk.mockbukkit.entity.PlayerMock in project IridiumSkyblock by Iridium-Development.
the class CreateCommandTest method executeWithExistingIslandName.
@Test
public void executeWithExistingIslandName() {
new IslandBuilder("IslandName").build();
PlayerMock playerMock = new UserBuilder(serverMock).buildPlayer();
serverMock.dispatchCommand(playerMock, "is create IslandName " + TestingHelper.getSchematicKey());
playerMock.assertSaid(StringUtils.color(IridiumSkyblock.getInstance().getMessages().islandWithNameAlreadyExists.replace("%prefix%", IridiumSkyblock.getInstance().getConfiguration().prefix)));
}
use of be.seeseemelk.mockbukkit.entity.PlayerMock in project IridiumSkyblock by Iridium-Development.
the class IslandManagerTest method teleportOtherIslandHomePublic.
@Test
public void teleportOtherIslandHomePublic() {
Island island = new IslandBuilder().build();
PlayerMock player = new UserBuilder(serverMock).buildPlayer();
IridiumSkyblock.getInstance().getIslandManager().teleportHome(player, island, 0);
assertEquals(island.getHome(), player.getLocation());
player.assertSaid(StringUtils.color(IridiumSkyblock.getInstance().getMessages().teleportingHomeOther.replace("%prefix%", IridiumSkyblock.getInstance().getConfiguration().prefix).replace("%owner%", island.getOwner().getName())));
}
use of be.seeseemelk.mockbukkit.entity.PlayerMock in project IridiumSkyblock by Iridium-Development.
the class IslandManagerTest method teleportOtherIslandHomeTrusted.
@Test
public void teleportOtherIslandHomeTrusted() {
Island island = new IslandBuilder().build();
PlayerMock player = new UserBuilder(serverMock).buildPlayer();
User user = IridiumSkyblock.getInstance().getUserManager().getUser(player);
island.setVisitable(false);
IridiumSkyblock.getInstance().getDatabaseManager().getIslandTrustedTableManager().addEntry(new IslandTrusted(island, user, user));
IridiumSkyblock.getInstance().getIslandManager().teleportHome(player, island, 0);
assertEquals(island.getHome(), player.getLocation());
player.assertSaid(StringUtils.color(IridiumSkyblock.getInstance().getMessages().teleportingHomeOther.replace("%prefix%", IridiumSkyblock.getInstance().getConfiguration().prefix).replace("%owner%", island.getOwner().getName())));
}
use of be.seeseemelk.mockbukkit.entity.PlayerMock in project IridiumSkyblock by Iridium-Development.
the class IslandManagerTest method teleportIslandHomePrivate.
@Test
public void teleportIslandHomePrivate() {
Island island = new IslandBuilder().build();
PlayerMock player = new UserBuilder(serverMock).buildPlayer();
island.setVisitable(false);
IridiumSkyblock.getInstance().getIslandManager().teleportHome(player, island, 0);
assertNotEquals(island.getHome(), player.getLocation());
player.assertSaid(StringUtils.color(IridiumSkyblock.getInstance().getMessages().islandIsPrivate.replace("%prefix%", IridiumSkyblock.getInstance().getConfiguration().prefix)));
}
Aggregations