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

Method runTest

code/src/itest/tokenmodel/AbilityDepthTest.java:94–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92
93
94 protected void runTest()
95 {
96 Ability top = createAbility("TopAbility");
97 Ability mid = createAbility("MidAbility");
98 Ability target = createAbility("TargetAbility");
99 ParseResult result =
100 firstToken.parseToken(context, top,
101 firstPrefix + mid.getKeyName());
102 if (!result.passed())
103 {
104 result.printMessages(TestURI.getURI());
105 fail();
106 }
107 result =
108 secondToken.parseToken(context, mid,
109 secondPrefix + target.getKeyName());
110 if (!result.passed())
111 {
112 result.printMessages(TestURI.getURI());
113 fail();
114 }
115
116 finishLoad();
117 assocCheck = new NoAssociations(pc);
118
119 CNAbilitySelection cas =
120 new CNAbilitySelection(CNAbilityFactory.getCNAbility(
121 BuildUtilities.getFeatCat(), Nature.AUTOMATIC, top));
122
123 assertEquals(0, getCount());
124 pc.addAbility(cas, "This", "That");
125 // directAbilityFacet.add(id, cas, UserSelection.getInstance());
126 assertTrue(containsExpected(mid));
127 assertTrue(containsExpected(target));
128 assertEquals(3, getCount());
129 pc.removeAbility(cas, "This", "That");
130 // directAbilityFacet.remove(id, cas, UserSelection.getInstance());
131 assertEquals(0, getCount());
132 }
133
134 private boolean containsExpected(Identified granted)
135 {

Callers

nothing calls this directly

Calls 14

createAbilityMethod · 0.95
passedMethod · 0.95
printMessagesMethod · 0.95
getURIMethod · 0.95
getCNAbilityMethod · 0.95
getFeatCatMethod · 0.95
getCountMethod · 0.95
containsExpectedMethod · 0.95
failMethod · 0.80
parseTokenMethod · 0.65
getKeyNameMethod · 0.65
addAbilityMethod · 0.65

Tested by

no test coverage detected