use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class AbilityListTokenTest method testTypes.
/**
* Test the output for positive numbers with fractions.
*/
public void testTypes() {
AbilityListToken tok = new AbilityListToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
is(tok.getToken("ABILITYLIST.FEAT", character, eh), strEq("Perform (Dance), Perform (Oratory), Silent Step"), "ABILITYLIST.FEAT");
is(tok.getToken("ABILITYLIST.FEAT.TYPE=Fighter", character, eh), strEq("Perform (Dance), Perform (Oratory)"), "ABILITYLIST.FEAT.TYPE=Fighter");
is(tok.getToken("ABILITYLIST.FEAT.!TYPE=Fighter", character, eh), strEq("Silent Step"), "ABILITYLIST.FEAT.!TYPE=Fighter");
}
use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class AbilityTokenTest method testAspect.
/**
* Tests the aspect subtoken of ABILITY without a specific aspect.
*/
public void testAspect() {
AbilityToken tok = new AbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("Age In Years: 2000, Colour: Green, Shape: Icosahedron, Sides: 20, Size: L", tok.getToken("ABILITY.FEAT.0.ASPECT", character, eh));
}
use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class AbilityTokenTest method testNonExistantSingleAspect.
/**
* Tests the ASPECT subtoken of ABILITY with an invalid aspect specified.
*/
public void testNonExistantSingleAspect() {
AbilityToken tok = new AbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("", tok.getToken("ABILITY.FEAT.0.ASPECT.-5", character, eh));
assertEquals("", tok.getToken("ABILITY.FEAT.0.ASPECT.5", character, eh));
assertEquals("", tok.getToken("ABILITY.FEAT.0.ASPECT.500", character, eh));
assertEquals("", tok.getToken("ABILITY.FEAT.0.ASPECT.Attack Type", character, eh));
assertEquals("", tok.getToken("ABILITY.FEAT.0.ASPECT.Target", character, eh));
}
use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class AbilityTokenTest method testSingleAspect.
/**
* Tests the ASPECT subtoken of ABILITY with an aspect specified.
*/
public void testSingleAspect() {
AbilityToken tok = new AbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("Shape: Icosahedron", tok.getToken("ABILITY.FEAT.0.ASPECT.2", character, eh));
assertEquals("20", tok.getToken("ABILITY.FEAT.0.ASPECT.Sides", character, eh));
assertEquals("Green", tok.getToken("ABILITY.FEAT.0.ASPECT.Colour", character, eh));
assertEquals("2000", tok.getToken("ABILITY.FEAT.0.ASPECT.Age In Years", character, eh));
}
use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class AbilityTokenTest method testKey.
/**
* Tests the key subtoken of ABILITY.
*/
public void testKey() {
AbilityToken tok = new AbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("KEY_Perform (Dance)", tok.getToken("ABILITY.FEAT.0.KEY", character, eh));
assertEquals("KEY_Skill Focus", tok.getToken("ABILITY.FEAT.1.KEY", character, eh));
}
Aggregations