use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class BioTokenTest 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();
}
use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class VAbilityTokenTest method testAspectCount.
/**
* Tests the ASPECTCOUNT subtoken of VABILITY.
*/
public void testAspectCount() {
VAbilityToken tok = new VAbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("5", tok.getToken("VABILITY.FEAT.0.ASPECTCOUNT", character, eh));
}
use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class VAbilityTokenTest method testAspect.
/**
* Tests the aspect subtoken of VABILITY without a specific aspect.
*/
public void testAspect() {
VAbilityToken tok = new VAbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("Age In Years: 2000, Colour: Green, Shape: Icosahedron, Sides: 20, Size: L", tok.getToken("VABILITY.FEAT.0.ASPECT", character, eh));
}
use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class VAbilityTokenTest method testKey.
/**
* Tests the key subtoken of VABILITY.
*/
public void testKey() {
VAbilityToken tok = new VAbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("KEY_Perform (Dance)", tok.getToken("VABILITY.FEAT.0.KEY", character, eh));
assertEquals("KEY_Skill Focus", tok.getToken("VABILITY.FEAT.1.KEY", character, eh));
}
use of pcgen.io.ExportHandler in project pcgen by PCGen.
the class VAbilityTokenTest method testHasAspect.
/**
* Tests the HASASPECT subtoken of VABILITY.
*/
public void testHasAspect() {
VAbilityToken tok = new VAbilityToken();
ExportHandler eh = new ExportHandler(null);
PlayerCharacter character = getCharacter();
assertEquals("N", tok.getToken("VABILITY.FEAT.0.HASASPECT.3", character, eh));
assertEquals("N", tok.getToken("VABILITY.FEAT.0.HASASPECT.5", character, eh));
assertEquals("N", tok.getToken("VABILITY.FEAT.0.HASASPECT.Attack Type", character, eh));
assertEquals("Y", tok.getToken("VABILITY.FEAT.0.HASASPECT.Colour", character, eh));
assertEquals("Y", tok.getToken("VABILITY.FEAT.0.HASASPECT.Age In Years", character, eh));
}
Aggregations