Search in sources :

Example 6 with HealthModifier

use of org.spongepowered.api.event.cause.entity.health.HealthModifier in project SpongeAPI by SpongePowered.

the class SpongeAbstractHealEntityEventTest method testNotApplicableModifer.

@Test(expected = IllegalArgumentException.class)
public void testNotApplicableModifer() {
    HealEntityEvent event = SpongeEventFactory.createHealEntityEvent(Cause.of(EventContext.empty(), "none"), Lists.newArrayList(), mockParam(Entity.class), 0);
    HealthModifier modifier = mockParam(HealthModifier.class);
    assertThat(event.isModifierApplicable(modifier), is(false));
    event.getOriginalHealingModifierAmount(modifier);
}
Also used : HealEntityEvent(org.spongepowered.api.event.entity.HealEntityEvent) Entity(org.spongepowered.api.entity.Entity) HealthModifier(org.spongepowered.api.event.cause.entity.health.HealthModifier) Test(org.junit.Test)

Aggregations

HealthModifier (org.spongepowered.api.event.cause.entity.health.HealthModifier)6 Test (org.junit.Test)5 Entity (org.spongepowered.api.entity.Entity)5 HealthFunction (org.spongepowered.api.event.cause.entity.health.HealthFunction)5 HealEntityEvent (org.spongepowered.api.event.entity.HealEntityEvent)5 Lists (com.google.common.collect.Lists)4 List (java.util.List)4 Map (java.util.Map)4 DoubleUnaryOperator (java.util.function.DoubleUnaryOperator)4 CoreMatchers.is (org.hamcrest.CoreMatchers.is)4 Matchers (org.hamcrest.Matchers)4 Matchers.closeTo (org.hamcrest.Matchers.closeTo)4 Assert.assertThat (org.junit.Assert.assertThat)4 Cause (org.spongepowered.api.event.cause.Cause)4 EventContext (org.spongepowered.api.event.cause.EventContext)4