MCPcopy Create free account
hub / github.com/PCGen/pcgen / testMinValueStat

Method testMinValueStat

code/src/test/pcgen/core/StatListTest.java:132–150  ·  view source on GitHub ↗

Test out the output of stats where a min value is in place.

()

Source from the content-addressed store, hash-verified

130 * Test out the output of stats where a min value is in place.
131 */
132 @Test
133 public void testMinValueStat()
134 {
135 PlayerCharacter pc = getCharacter();
136 assertEquals("Starting STR should be 6", 6, pc.getTotalStatFor(str));
137 assertEquals("Starting STR mod", -2, pc.getStatModFor(str));
138
139 // With template lock
140 PCTemplate statMinValTemplate = new PCTemplate();
141 statMinValTemplate.setName("minval");
142 statMinValTemplate.addToListFor(ListKey.STAT_MINVALUE, new StatLock(
143 CDOMDirectSingleRef.getRef(str), FormulaFactory.getFormulaFor(8)));
144 pc.addTemplate(statMinValTemplate);
145 assertEquals("STR now has minimum value", 8, pc.getTotalStatFor(str));
146 assertEquals("Starting STR mod", -1, pc.getStatModFor(str));
147 pc.removeTemplate(statMinValTemplate);
148 assertEquals("STR no longer has minimum value", 6, pc.getTotalStatFor(str));
149 assertEquals("Starting STR mod", -2, pc.getStatModFor(str));
150 }
151
152}

Callers

nothing calls this directly

Calls 9

getTotalStatForMethod · 0.95
getStatModForMethod · 0.95
getRefMethod · 0.95
getFormulaForMethod · 0.95
addTemplateMethod · 0.95
removeTemplateMethod · 0.95
setNameMethod · 0.65
addToListForMethod · 0.65
getCharacterMethod · 0.45

Tested by

no test coverage detected