@Test public void learnsEffects() throws Exception { IBasicCharacterData data = createData(); DummyCondition condition = createCondition(); Subeffect effect = new Subeffect("id", data, condition); // $NON-NLS-1$ IMultipleEffectCharm charm = createCharm(effect); MultipleEffectCharmConfiguration configuration = new MultipleEffectCharmConfiguration(new DummyCharacterModelContext(), null, charm, null); effect.setExperienceLearned(true); configuration.learn(true); assertTrue(effect.isLearned()); assertFalse(effect.isCreationLearned()); }
@Test public void testIsCorrectlyLearned() throws Exception { DummyCondition condition = new DummyCondition(); Subeffect subeffect = new Subeffect("Effective", new DummyBasicCharacterData(), condition); // $NON-NLS-1$ subeffect.setLearned(true); Assert.assertFalse(subeffect.isLearned()); condition.setValue(true); subeffect.setLearned(true); Assert.assertTrue(subeffect.isLearned()); condition.setValue(false); subeffect.setLearned(false); Assert.assertFalse(subeffect.isLearned()); }