use of pcgen.rules.persistence.token.ModifierFactory in project pcgen by PCGen.
the class SetBooleanModifierTest method testInvalidConstruction.
@Test
public void testInvalidConstruction() {
try {
ModifierFactory m = new SetModifierFactory();
m.getModifier(100, null, new ManagerFactory() {
}, null, null, null);
fail("Expected SetModifier with null set value to fail");
} catch (IllegalArgumentException | NullPointerException e) {
//Yep!
}
}
use of pcgen.rules.persistence.token.ModifierFactory in project pcgen by PCGen.
the class AddNumberModifierTest method testInvalidConstruction.
@Test
public void testInvalidConstruction() {
try {
ModifierFactory m = new AddModifierFactory();
m.getModifier(100, null, new ManagerFactory() {
}, null, null, null);
fail("Expected AddModifier with null adder to fail");
} catch (IllegalArgumentException | NullPointerException e) {
//Yep!
}
}
use of pcgen.rules.persistence.token.ModifierFactory in project pcgen by PCGen.
the class SetBooleanModifierTest method testGetModifier.
@Test
public void testGetModifier() {
ModifierFactory factory = new SetModifierFactory();
Modifier<Boolean> modifier = factory.getModifier(5, "True", new ManagerFactory() {
}, null, varScope, booleanManager);
assertEquals(5L << 32, modifier.getPriority());
assertSame(Boolean.class, modifier.getVariableFormat());
assertEquals(Boolean.TRUE, modifier.process(EvalManagerUtilities.getInputEM(Boolean.FALSE)));
}
use of pcgen.rules.persistence.token.ModifierFactory in project pcgen by PCGen.
the class MinNumberModifierTest method testInvalidConstruction.
@Test
public void testInvalidConstruction() {
try {
ModifierFactory m = new MinModifierFactory();
m.getModifier(100, null, new ManagerFactory() {
}, null, null, null);
fail("Expected MaxModifier with null compare value to fail");
} catch (IllegalArgumentException | NullPointerException e) {
//Yep!
}
}
Aggregations