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

Method setUp

code/src/test/plugin/exporttokens/AttackTokenTest.java:45–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 PCClass myClass = new PCClass();
44
45 @BeforeEach
46 @Override
47 protected void setUp() throws Exception
48 {
49 super.setUp();
50 PlayerCharacter character = getCharacter();
51 setPCStat(character, str, 14);
52 str.removeListFor(ListKey.BONUS);
53 LoadContext context = Globals.getContext();
54 final BonusObj aBonus = Bonus.newBonus(context, "COMBAT|TOHIT.Melee|STR|TYPE=Ability");
55
56 if (aBonus != null)
57 {
58 str.addToListFor(ListKey.BONUS, aBonus);
59 }
60// // Ignoring max dex
61// stat.addBonusList("COMBAT|AC|DEX|TYPE=Ability");
62
63 EquipSet def = new EquipSet("0.1", "Default");
64 character.addEquipSet(def);
65 character.setCalcEquipmentList();
66
67 character.calcActiveBonuses();
68
69 myClass.setName("My Class");
70 myClass.put(FormulaKey.START_SKILL_POINTS, FormulaFactory.getFormulaFor(3));
71 final BonusObj babClassBonus = Bonus.newBonus(context, "COMBAT|BASEAB|CL+5");
72 myClass.getOriginalClassLevel(1).addToListFor(ListKey.BONUS, babClassBonus);
73 Globals.getContext().getReferenceContext().importObject(myClass);
74
75 }
76
77 /**
78 * Test the character's attack calcs with no bonus.

Callers

nothing calls this directly

Calls 15

getContextMethod · 0.95
newBonusMethod · 0.95
addEquipSetMethod · 0.95
setCalcEquipmentListMethod · 0.95
calcActiveBonusesMethod · 0.95
getFormulaForMethod · 0.95
getOriginalClassLevelMethod · 0.80
importObjectMethod · 0.80
removeListForMethod · 0.65
addToListForMethod · 0.65
setNameMethod · 0.65
putMethod · 0.65

Tested by

no test coverage detected