package de.gurkenlabs.litiengine.attributes;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

class AttributeModifierTest {

  @Test
  void testInitAttributeModifier() {
    final AttributeModifier<Integer> testAttributeModifier = new AttributeModifier<>(Modification.ADD, 5);
    assertEquals(Modification.ADD, testAttributeModifier.getModification());
    assertEquals(5.0, testAttributeModifier.getModifyValue());
    assertTrue(testAttributeModifier.isActive());
  }

  @Test
  void testModifyValueWithInactiveAttributeModifier() {
    final AttributeModifier<Integer> testAttributeModifierActive = new AttributeModifier<>(Modification.ADD, 5);
    final AttributeModifier<Integer> testAttributeModifierInactive = new AttributeModifier<>(Modification.ADD, 5);
    testAttributeModifierActive.setActive(true);
    testAttributeModifierInactive.setActive(false);

    assertEquals(7, testAttributeModifierActive.modify(2));
    assertEquals(2, testAttributeModifierInactive.modify(2));
  }
}
@@ -625,32 +625,38 @@
 ttributeModifier
+Active
 () %7B%0A    final A
@@ -757,30 +757,28 @@
 DD, 5);%0A    
-final 
+test
 AttributeMod
@@ -778,33 +778,67 @@
 buteModifier
-%3CInteger%3E
+Active.setActive(true);%0A    assertEquals(7,
  testAttribu
@@ -851,186 +851,222 @@
 fier
-Ina
+A
 ctive
- = new AttributeModifier%3C%3E(Modification.ADD, 5);%0A    testAttributeModifierActive.setActive(true);%0A    testAttributeModifierInactive.setActive(false
+.modify(2));%0A  %7D%0A%0A  @Test%0A  void testModifyValueWithInactiveAttributeModifierInactive() %7B%0A    final AttributeModifier%3CInteger%3E testAttributeModifierInactive = new AttributeModifier%3C%3E(Modification.ADD, 5
 );%0A
-%0A
    
- assertEquals(7,
  tes
@@ -1083,32 +1083,40 @@
 Modifier
-A
+Ina
 ctive.
-modify(2)
+setActive(false
 );%0A    a

Split eager test AttributeModifierTest