use of pcgen.core.PlayerCharacter in project pcgen by PCGen.
the class AbilityTokenTest method testAssociatedCount.
/**
* Tests the ASSOCIATEDCOUNT subtoken of ABILITY.
*/
public void testAssociatedCount() {
AbilityToken tok = new AbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("0", tok.getToken("ABILITY.FEAT.0.ASSOCIATEDCOUNT", character, eh));
assertEquals("2", tok.getToken("ABILITY.FEAT.1.ASSOCIATEDCOUNT", character, eh));
}
use of pcgen.core.PlayerCharacter in project pcgen by PCGen.
the class AbilityTokenTest method testHasAspect.
/**
* Tests the HASASPECT subtoken of ABILITY.
*/
public void testHasAspect() {
AbilityToken tok = new AbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("N", tok.getToken("ABILITY.FEAT.0.HASASPECT.3", character, eh));
assertEquals("N", tok.getToken("ABILITY.FEAT.0.HASASPECT.5", character, eh));
assertEquals("N", tok.getToken("ABILITY.FEAT.0.HASASPECT.Attack Type", character, eh));
assertEquals("Y", tok.getToken("ABILITY.FEAT.0.HASASPECT.Colour", character, eh));
assertEquals("Y", tok.getToken("ABILITY.FEAT.0.HASASPECT.Age In Years", character, eh));
}
use of pcgen.core.PlayerCharacter in project pcgen by PCGen.
the class AbilityTokenTest method testAspectCount.
/**
* Tests the ASPECTCOUNT subtoken of ABILITY.
*/
public void testAspectCount() {
AbilityToken tok = new AbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("5", tok.getToken("ABILITY.FEAT.0.ASPECTCOUNT", character, eh));
}
use of pcgen.core.PlayerCharacter in project pcgen by PCGen.
the class AbilityTokenTest method testName.
/**
* Tests the name subtoken of ABILITY.
*/
public void testName() {
AbilityToken tok = new AbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("Perform (Dance)", tok.getToken("ABILITY.FEAT.0.NAME", character, eh));
assertEquals("Skill Focus", tok.getToken("ABILITY.FEAT.1.NAME", character, eh));
}
use of pcgen.core.PlayerCharacter in project pcgen by PCGen.
the class PreBaseSizeTest method testBaseSizePlusMod.
/**
* Tests to make sure the base size does not includ SIZEMOD adjustments
* @throws Exception
*/
public void testBaseSizePlusMod() throws Exception {
final PlayerCharacter character = getCharacter();
LoadContext context = Globals.getContext();
character.setRace(race);
final BonusObj sizeBonus = Bonus.newBonus(context, "SIZEMOD|NUMBER|1");
race.addToListFor(ListKey.BONUS, sizeBonus);
character.calcActiveBonuses();
Prerequisite prereq;
final PreParserFactory factory = PreParserFactory.getInstance();
prereq = factory.parse("PREBASESIZEEQ:Medium");
assertTrue("Character's base size should be equal to Medium", PrereqHandler.passes(prereq, character, null));
prereq = factory.parse("PREBASESIZELTEQ:Medium");
assertTrue("Character's base size should be <= to Medium", PrereqHandler.passes(prereq, character, null));
prereq = factory.parse("PREBASESIZEGTEQ:Medium");
assertTrue("Character's base size should be >= to Medium", PrereqHandler.passes(prereq, character, null));
prereq = factory.parse("PREBASESIZEGT:Small");
assertTrue("Character's base size should be > to Small", PrereqHandler.passes(prereq, character, null));
prereq = factory.parse("PREBASESIZELT:Large");
assertTrue("Character's base size should be < to Large", PrereqHandler.passes(prereq, character, null));
prereq = factory.parse("PREBASESIZELT:Medium");
assertFalse("Character's base size should not be < to Medium", PrereqHandler.passes(prereq, character, null));
prereq = factory.parse("PREBASESIZEGT:Medium");
assertFalse("Character's base size should not be > to Medium", PrereqHandler.passes(prereq, character, null));
}
Aggregations