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

Method setUp

code/src/test/pcgen/core/prereq/PreSkillTest.java:46–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 private Skill tumble = null;
45
46 @BeforeEach
47 @Override
48 public void setUp() throws Exception
49 {
50 super.setUp();
51 final PlayerCharacter character = getCharacter();
52
53 final PCClass myClass = new PCClass();
54 myClass.setName("My Class");
55
56 LoadContext context = Globals.getContext();
57
58 knowledge = new Skill();
59 context.unconditionallyProcess(knowledge, "CLASSES", "MyClass");
60 knowledge.setName("KNOWLEDGE (ARCANA)");
61 TestHelper.addType(knowledge, "KNOWLEDGE.INT");
62 context.getReferenceContext().importObject(knowledge);
63 SkillRankControl.modRanks(6.0, myClass, true, character, knowledge);
64
65 Skill knowledge2 = new Skill();
66 context.unconditionallyProcess(knowledge2, "CLASSES", "MyClass");
67 knowledge2.setName("KNOWLEDGE (NATURE)");
68 TestHelper.addType(knowledge2, "KNOWLEDGE.INT");
69 context.getReferenceContext().importObject(knowledge2);
70 SkillRankControl.modRanks(8.0, myClass, true, character, knowledge2);
71
72 tumble = new Skill();
73 context.unconditionallyProcess(tumble, "CLASSES", "MyClass");
74 tumble.setName("Tumble");
75 tumble.addToListFor(ListKey.TYPE, Type.getConstant("DEX"));
76 context.getReferenceContext().importObject(tumble);
77 SkillRankControl.modRanks(8.0, myClass, true, character, tumble);
78
79 balance = new Skill();
80 context.unconditionallyProcess(balance, "CLASSES", "MyClass");
81 balance.setName("Balance");
82 balance.addToListFor(ListKey.TYPE, Type.getConstant("DEX"));
83 context.getReferenceContext().importObject(balance);
84 SkillRankControl.modRanks(4.0, myClass, true, character, balance);
85
86 Skill target = new Skill();
87 context.unconditionallyProcess(target, "CLASSES", "MyClass");
88 target.setName("Target");
89 target.addToListFor(ListKey.TYPE, Type.getConstant("STR"));
90 context.getReferenceContext().importObject(target);
91
92 Skill target2 = new Skill();
93 context.unconditionallyProcess(target2, "CLASSES", "MyClass");
94 target2.setName("Target2");
95 target2.addToListFor(ListKey.TYPE, Type.getConstant("STR"));
96 context.getReferenceContext().importObject(target2);
97
98 Skill fake = new Skill();
99 context.unconditionallyProcess(fake, "CLASSES", "MyClass");
100 fake.setName("Fake");
101 fake.addToListFor(ListKey.TYPE, Type.getConstant("WIS"));
102 fake.addToListFor(ListKey.SERVES_AS_SKILL, CDOMDirectSingleRef.getRef(target));
103 fake.addToListFor(ListKey.SERVES_AS_SKILL, CDOMDirectSingleRef.getRef(target2));

Callers

nothing calls this directly

Calls 13

getContextMethod · 0.95
addTypeMethod · 0.95
getReferenceContextMethod · 0.95
modRanksMethod · 0.95
getConstantMethod · 0.95
getRefMethod · 0.95
importObjectMethod · 0.80
buildDerivedObjectsMethod · 0.80
setNameMethod · 0.65
addToListForMethod · 0.65
resolveReferencesMethod · 0.65

Tested by

no test coverage detected