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

Method testGetTotalStatFor

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

Test method for pcgen.core.PlayerCharacter#getTotalStatFor(PCStat).

()

Source from the content-addressed store, hash-verified

105 * Test method for {@link pcgen.core.PlayerCharacter#getTotalStatFor(PCStat)}.
106 */
107 @Test
108 public void testGetTotalStatFor()
109 {
110 PlayerCharacter pc = getCharacter();
111 assertEquals("Starting STR should be 6", 6, pc.getTotalStatFor(str));
112
113 // Bonus should affect total stat
114 addAbility(BuildUtilities.getFeatCat(), bonus);
115 pc.calcActiveBonuses();
116 assertEquals("Stat should have bonus", 13, pc.getTotalStatFor(str));
117
118 pc.addTemplate(locker);
119 assertEquals("Stat should now be locked", 12, pc.getTotalStatFor(str));
120
121 addAbility(BuildUtilities.getFeatCat(), lockedBonus);
122 pc.calcActiveBonuses();
123 assertEquals("Stat should be locked but bonused", 15, pc.getTotalStatFor(str));
124
125 pc.addTemplate(unlocker);
126 assertEquals("Stat should now be unlocked", 13, pc.getTotalStatFor(str));
127 }
128
129 /**
130 * Test out the output of stats where a min value is in place.

Callers

nothing calls this directly

Calls 6

getTotalStatForMethod · 0.95
getFeatCatMethod · 0.95
calcActiveBonusesMethod · 0.95
addTemplateMethod · 0.95
addAbilityMethod · 0.65
getCharacterMethod · 0.45

Tested by

no test coverage detected