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

Method setUp

code/src/test/pcgen/core/StatListTest.java:48–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46 Ability lockedBonus;
47
48 @BeforeEach
49 @Override
50 public void setUp() throws Exception
51 {
52 super.setUp();
53 PlayerCharacter pc = getCharacter();
54 LoadContext context = Globals.getContext();
55
56 locker = new PCTemplate();
57 locker.setName("locker");
58 CDOMDirectSingleRef<PCStat> strRef = CDOMDirectSingleRef.getRef(str);
59 locker.addToListFor(ListKey.STAT_LOCKS, new StatLock(strRef, FormulaFactory.getFormulaFor(12)));
60 unlocker = new PCTemplate();
61 unlocker.setName("unlocker");
62 unlocker.addToListFor(ListKey.UNLOCKED_STATS, strRef);
63 bonus = TestHelper.makeAbility("Bonus", BuildUtilities.getFeatCat(), "General.Fighter");
64 BonusObj aBonus = Bonus.newBonus(context, "STAT|STR|7|TYPE=Enhancement");
65 if (aBonus != null)
66 {
67 bonus.addToListFor(ListKey.BONUS, aBonus);
68 }
69 lockedBonus = TestHelper.makeAbility("LockedBonus", BuildUtilities.getFeatCat(), "General.Fighter");
70 aBonus = Bonus.newBonus(context, "LOCKEDSTAT|STR|3|TYPE=Morale");
71 if (aBonus != null)
72 {
73 lockedBonus.addToListFor(ListKey.BONUS, aBonus);
74 }
75
76 setPCStat(pc, str, 6);
77 }
78
79 /**
80 * Test method for {@link pcgen.core.PlayerCharacter#getBaseStatFor(PCStat)}.

Callers

nothing calls this directly

Calls 10

getContextMethod · 0.95
getRefMethod · 0.95
getFormulaForMethod · 0.95
makeAbilityMethod · 0.95
getFeatCatMethod · 0.95
newBonusMethod · 0.95
setNameMethod · 0.65
addToListForMethod · 0.65
getCharacterMethod · 0.45
setPCStatMethod · 0.45

Tested by

no test coverage detected