use of pcgen.io.ExportHandler 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.io.ExportHandler 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.io.ExportHandler 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.io.ExportHandler in project pcgen by PCGen.
the class VAbilityTokenTest method testNonExistantSingleAspect.
/**
* Tests the ASPECT subtoken of VABILITY with an invalid aspect specified.
*/
public void testNonExistantSingleAspect() {
VAbilityToken tok = new VAbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("", tok.getToken("VABILITY.FEAT.0.ASPECT.-5", character, eh));
assertEquals("", tok.getToken("VABILITY.FEAT.0.ASPECT.5", character, eh));
assertEquals("", tok.getToken("VABILITY.FEAT.0.ASPECT.500", character, eh));
assertEquals("", tok.getToken("VABILITY.FEAT.0.ASPECT.Attack Type", character, eh));
assertEquals("", tok.getToken("VABILITY.FEAT.0.ASPECT.Target", character, eh));
}
use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class CampaignHistoryTokenTest method evaluateToken.
private String evaluateToken(String token, PlayerCharacter pc) throws IOException {
StringWriter retWriter = new StringWriter();
BufferedWriter bufWriter = new BufferedWriter(retWriter);
ExportHandler export = new ExportHandler(new File(""));
export.replaceTokenSkipMath(pc, token, bufWriter);
retWriter.flush();
bufWriter.flush();
return retWriter.toString();
}
Aggregations