Search in sources :

Example 1 with SimpleVariableStore

use of pcgen.base.formula.inst.SimpleVariableStore in project pcgen by PCGen.

the class SetNumberModifierTest method testGetFormulaModifier.

@Test
public void testGetFormulaModifier() {
    SplitFormulaSetup setup = new SplitFormulaSetup();
    setup.loadBuiltIns();
    setup.getLegalScopeLibrary().registerScope(varScope);
    IndividualSetup iSetup = new IndividualSetup(setup, "Global", new SimpleVariableStore());
    SetModifierFactory factory = new SetModifierFactory();
    Modifier<Number> modifier = factory.getModifier(35, "6+5", new ManagerFactory() {
    }, iSetup.getFormulaManager(), varScope, numManager);
    assertEquals((35L << 32) + factory.getInherentPriority(), modifier.getPriority());
    assertSame(Number.class, modifier.getVariableFormat());
    EvaluationManager evalManager = EvalManagerUtilities.getInputEM(4.3);
    assertEquals(11, modifier.process(evalManager.getWith(EvaluationManager.FMANAGER, iSetup.getFormulaManager())));
}
Also used : SplitFormulaSetup(pcgen.base.solver.SplitFormulaSetup) ManagerFactory(pcgen.base.formula.base.ManagerFactory) SimpleVariableStore(pcgen.base.formula.inst.SimpleVariableStore) IndividualSetup(pcgen.base.solver.IndividualSetup) EvaluationManager(pcgen.base.formula.base.EvaluationManager) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 EvaluationManager (pcgen.base.formula.base.EvaluationManager)1 ManagerFactory (pcgen.base.formula.base.ManagerFactory)1 SimpleVariableStore (pcgen.base.formula.inst.SimpleVariableStore)1 IndividualSetup (pcgen.base.solver.IndividualSetup)1 SplitFormulaSetup (pcgen.base.solver.SplitFormulaSetup)1