use of plugin.lsttokens.skill.ExclusiveToken in project pcgen by PCGen.
the class DomainCcSkillTest method testList.
@Test
public void testList() throws PersistenceLayerException {
Domain source = create(Domain.class, "Source");
ParseResult result = token.parseToken(context, source, "LIST");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
result = CHOOSE_SKILL_TOKEN.parseToken(context, source, "MySkill");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
new ExclusiveToken().parseToken(context, sk, "Yes");
finishLoad();
assertFalse(lascFacet.contains(id, dragon, SkillCost.CROSS_CLASS, sk));
assertEquals(SkillCost.EXCLUSIVE, pc.getSkillCostForClass(sk, dragon));
domainInputFacet.add(id, source, new ClassSource(dragon, 0));
assertTrue(lascFacet.contains(id, dragon, SkillCost.CROSS_CLASS, sk));
pc.addClass(dragon);
pc.setDirty(true);
assertEquals(SkillCost.CROSS_CLASS, pc.getSkillCostForClass(sk, dragon));
domainInputFacet.remove(id, source);
assertFalse(lascFacet.contains(id, dragon, SkillCost.CROSS_CLASS, sk));
}
use of plugin.lsttokens.skill.ExclusiveToken in project pcgen by PCGen.
the class DomainCcSkillTest method testDirect.
@Test
public void testDirect() throws PersistenceLayerException {
Domain source = create(Domain.class, "Source");
ParseResult result = token.parseToken(context, source, "MySkill");
if (result != ParseResult.SUCCESS) {
result.printMessages();
fail("Test Setup Failed");
}
new ExclusiveToken().parseToken(context, sk, "Yes");
finishLoad();
assertEquals(SkillCost.EXCLUSIVE, pc.getSkillCostForClass(sk, dragon));
domainInputFacet.add(id, source, new ClassSource(dragon, 0));
assertTrue(lscFacet.contains(id, dragon, SkillCost.CROSS_CLASS, sk));
pc.addClass(dragon);
pc.setDirty(true);
assertEquals(SkillCost.CROSS_CLASS, pc.getSkillCostForClass(sk, dragon));
domainInputFacet.remove(id, source);
assertFalse(lscFacet.contains(id, dragon, SkillCost.CROSS_CLASS, sk));
}
Aggregations