use of icbm.classic.lib.capability.ex.CapabilityExplosiveEntity in project ICBM-Classic by BuiltBrokenModding.
the class EntityGrenadeTest method getCapability_explosiveCap.
@Test
void getCapability_explosiveCap() {
final EntityGrenade entityGrenade = new EntityGrenade(testManager.getWorld());
// Mock cast as mockito is odd
Mockito.when(ICBMClassicAPI.EXPLOSIVE_CAPABILITY.cast(entityGrenade.explosive)).thenReturn(entityGrenade.explosive);
final IExplosive capability = entityGrenade.getCapability(ICBMClassicAPI.EXPLOSIVE_CAPABILITY, null);
// Should return a capability for an entity
Assertions.assertTrue(capability instanceof CapabilityExplosiveEntity, "Should have an explosive entity cap");
final CapabilityExplosiveEntity cap = (CapabilityExplosiveEntity) capability;
// Should contain the entity in question
Assertions.assertSame(cap.entity, entityGrenade);
}
Aggregations