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

Method testPasses

code/src/test/pcgen/core/PrereqHandlerTest.java:29–53  ·  view source on GitHub ↗

Test the passes method. Currently this concentrates on making sure the invert result is working. @throws PersistenceLayerException the persistence layer exception

()

Source from the content-addressed store, hash-verified

27 * @throws PersistenceLayerException the persistence layer exception
28 */
29 @Test
30 public void testPasses() throws PersistenceLayerException
31 {
32 final PreParserFactory factory = PreParserFactory.getInstance();
33
34 final Prerequisite prereqNeg = factory.parse("!PREALIGN:LG,LN,LE");
35 final Prerequisite prereq = factory.parse("PREALIGN:NG,TN,NE,CG,CN,CE");
36
37 final PlayerCharacter pc = getCharacter();
38 final Race human = new Race();
39 human.setName("Human");
40 pc.setRace(human);
41
42 AlignmentCompat.setCurrentAlignment(pc.getCharID(), le);
43 assertFalse("Non-negate returns false", PrereqHandler.passes(
44 prereq, pc, null));
45 assertFalse("Negate returns false", PrereqHandler.passes(
46 prereqNeg, pc, null));
47
48 AlignmentCompat.setCurrentAlignment(pc.getCharID(), tn);
49 assertTrue("Non-negate returns true", PrereqHandler.passes(
50 prereq, pc, null));
51 assertTrue("Negate returns true", PrereqHandler.passes(
52 prereqNeg, pc, null));
53 }
54
55 /**
56 * Tests PREFEAT.

Callers

nothing calls this directly

Calls 8

getInstanceMethod · 0.95
parseMethod · 0.95
setRaceMethod · 0.95
setCurrentAlignmentMethod · 0.95
getCharIDMethod · 0.95
passesMethod · 0.95
setNameMethod · 0.65
getCharacterMethod · 0.45

Tested by

no test coverage detected