mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 13:15:28 +01:00
Removed tests.
This commit is contained in:
parent
2ee03cd081
commit
4472817b07
@ -1123,78 +1123,4 @@ public class IslandsManagerTest {
|
||||
assertEquals(island, im.getIslandById(uuid).get());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link IslandsManager#fixIslandCenter(Island)}.
|
||||
*/
|
||||
@Test
|
||||
public void testFixIslandCenter() {
|
||||
// Setup
|
||||
when(iwm.inWorld(Mockito.any(World.class))).thenReturn(true);
|
||||
when(iwm.getIslandXOffset(Mockito.any())).thenReturn(0);
|
||||
when(iwm.getIslandZOffset(Mockito.any())).thenReturn(0);
|
||||
Island island = mock(Island.class);
|
||||
Location center = mock(Location.class);
|
||||
when(center.getWorld()).thenReturn(world);
|
||||
when(center.getBlockX()).thenReturn(129);
|
||||
when(center.getBlockY()).thenReturn(120);
|
||||
when(center.getBlockZ()).thenReturn(127);
|
||||
when(island.getCenter()).thenReturn(center);
|
||||
when(island.getRange()).thenReturn(64);
|
||||
when(island.getWorld()).thenReturn(world);
|
||||
// Test
|
||||
IslandsManager im = new IslandsManager(plugin);
|
||||
im.fixIslandCenter(island);
|
||||
Location loc = new Location(world, 128, 120, 128);
|
||||
Mockito.verify(island).setCenter(Mockito.eq(loc));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link IslandsManager#fixIslandCenter(Island)}.
|
||||
*/
|
||||
@Test
|
||||
public void testFixIslandCenterOffsets() {
|
||||
// Setup
|
||||
when(iwm.inWorld(Mockito.any(World.class))).thenReturn(true);
|
||||
when(iwm.getIslandXOffset(Mockito.any())).thenReturn(10);
|
||||
when(iwm.getIslandZOffset(Mockito.any())).thenReturn(10);
|
||||
Island island = mock(Island.class);
|
||||
Location center = mock(Location.class);
|
||||
when(center.getWorld()).thenReturn(world);
|
||||
when(center.getBlockX()).thenReturn(1295);
|
||||
when(center.getBlockY()).thenReturn(120);
|
||||
when(center.getBlockZ()).thenReturn(1295);
|
||||
when(island.getCenter()).thenReturn(center);
|
||||
when(island.getRange()).thenReturn(64);
|
||||
when(island.getWorld()).thenReturn(world);
|
||||
// Test
|
||||
IslandsManager im = new IslandsManager(plugin);
|
||||
im.fixIslandCenter(island);
|
||||
Location loc = new Location(world, 1290, 120, 1290);
|
||||
Mockito.verify(island).setCenter(Mockito.eq(loc));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link IslandsManager#fixIslandCenter(Island)}.
|
||||
*/
|
||||
@Test
|
||||
public void testFixIslandCenterOffsetsNegatives() {
|
||||
// Setup
|
||||
when(iwm.inWorld(Mockito.any(World.class))).thenReturn(true);
|
||||
when(iwm.getIslandXOffset(Mockito.any())).thenReturn(0);
|
||||
when(iwm.getIslandZOffset(Mockito.any())).thenReturn(0);
|
||||
Island island = mock(Island.class);
|
||||
Location center = mock(Location.class);
|
||||
when(center.getWorld()).thenReturn(world);
|
||||
when(center.getBlockX()).thenReturn(-1295);
|
||||
when(center.getBlockY()).thenReturn(120);
|
||||
when(center.getBlockZ()).thenReturn(-1287);
|
||||
when(island.getCenter()).thenReturn(center);
|
||||
when(island.getRange()).thenReturn(64);
|
||||
when(island.getWorld()).thenReturn(world);
|
||||
// Test
|
||||
IslandsManager im = new IslandsManager(plugin);
|
||||
im.fixIslandCenter(island);
|
||||
Location loc = new Location(world, -1280, 120, -1280);
|
||||
Mockito.verify(island).setCenter(Mockito.eq(loc));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user