Search in sources :

Example 1 with MCBlock

use of com.laytonsmith.abstraction.blocks.MCBlock in project CommandHelper by EngineHub.

the class PlayerManangementTest method testPcursor.

@Test(timeout = 10000)
public void testPcursor() throws Exception, Exception {
    MCBlock b = mock(MCBlock.class);
    CommandHelperPlugin.myServer = fakeServer;
    when(fakeServer.getPlayer(fakePlayer.getName())).thenReturn(fakePlayer);
    when(fakePlayer.getTargetBlock((HashSet) eq(null), anyInt())).thenReturn(b);
    MCWorld w = mock(MCWorld.class);
    MCLocation loc = StaticTest.GetFakeLocation(w, 0, 0, 0);
    when(b.getLocation()).thenReturn(loc);
    when(b.getWorld()).thenReturn(w);
    Run("pcursor()", fakePlayer);
    verify(fakePlayer, times(1)).getTargetBlock((HashSet) eq(null), anyInt());
}
Also used : MCLocation(com.laytonsmith.abstraction.MCLocation) MCBlock(com.laytonsmith.abstraction.blocks.MCBlock) MCWorld(com.laytonsmith.abstraction.MCWorld) BukkitMCWorld(com.laytonsmith.abstraction.bukkit.BukkitMCWorld) Test(org.junit.Test) StaticTest(com.laytonsmith.testing.StaticTest)

Aggregations

MCLocation (com.laytonsmith.abstraction.MCLocation)1 MCWorld (com.laytonsmith.abstraction.MCWorld)1 MCBlock (com.laytonsmith.abstraction.blocks.MCBlock)1 BukkitMCWorld (com.laytonsmith.abstraction.bukkit.BukkitMCWorld)1 StaticTest (com.laytonsmith.testing.StaticTest)1 Test (org.junit.Test)1