use of com.laytonsmith.abstraction.bukkit.BukkitMCWorld in project CommandHelper by EngineHub.
the class PlayerManangementTest method testPloc.
// @Test(timeout = 10000)
// public void testAllPlayers() throws Exception {
// String script = "all_players()";
// String done = SRun(script, fakePlayer);
// //This output is too long to test with msg()
// assertEquals("{player1, player2, player3, player}", done);
// }
@Test
public void testPloc() throws Exception, Exception {
String script = "msg(ploc())";
BukkitMCWorld w = GetWorld("world");
MCLocation loc = StaticLayer.GetLocation(w, 0, 1, 0);
when(fakePlayer.getLocation()).thenReturn(loc);
when(fakePlayer.getWorld()).thenReturn(w);
SRun(script, fakePlayer);
verify(fakePlayer).sendMessage("{0: 0.0, 1: 1.0, 2: 0.0, 3: world, 4: 0.0, 5: 0.0, pitch: 0.0, world: world, x: 0.0, y: 1.0, yaw: 0.0, z: 0.0}");
}
use of com.laytonsmith.abstraction.bukkit.BukkitMCWorld in project CommandHelper by EngineHub.
the class StaticTest method GetWorld.
public static BukkitMCWorld GetWorld(String name) {
BukkitMCWorld w = mock(BukkitMCWorld.class);
when(w.getName()).thenReturn(name);
return w;
}
Aggregations