Search in sources :

Example 1 with PreSkillTotalParser

use of plugin.pretokens.parser.PreSkillTotalParser in project pcgen by PCGen.

the class PreSkillTotParserTest method testNot.

/**
	 * @throws Exception
	 */
@Test
public void testNot() throws Exception {
    PreSkillTotalParser producer = new PreSkillTotalParser();
    Prerequisite prereq = producer.parse("SKILLTOT", "Spot,Listen,Search=30", true, false);
    assertEquals("<prereq operator=\"LT\" operand=\"30\" >\n" + "<prereq kind=\"skill\" total-values=\"true\" key=\"Spot\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "<prereq kind=\"skill\" total-values=\"true\" key=\"Listen\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "<prereq kind=\"skill\" total-values=\"true\" key=\"Search\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "</prereq>\n", prereq.toString());
}
Also used : PreSkillTotalParser(plugin.pretokens.parser.PreSkillTotalParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 2 with PreSkillTotalParser

use of plugin.pretokens.parser.PreSkillTotalParser in project pcgen by PCGen.

the class PreSkillTotParserTest method testTypeKnowledge.

@Test
public void testTypeKnowledge() throws Exception {
    PreSkillTotalParser producer = new PreSkillTotalParser();
    Prerequisite prereq = producer.parse("SKILLTOT", "TYPE.Knowledge=20", false, false);
    assertEquals("<prereq operator=\"GTEQ\" operand=\"20\" >\n" + "<prereq kind=\"skill\" total-values=\"true\" key=\"TYPE.Knowledge\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "</prereq>\n", prereq.toString());
}
Also used : PreSkillTotalParser(plugin.pretokens.parser.PreSkillTotalParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 3 with PreSkillTotalParser

use of plugin.pretokens.parser.PreSkillTotalParser in project pcgen by PCGen.

the class PreSkillTotParserTest method test1.

/**
	 * @throws Exception
	 */
@Test
public void test1() throws Exception {
    PreSkillTotalParser producer = new PreSkillTotalParser();
    Prerequisite prereq = producer.parse("SKILLTOT", "Spot,Listen,Search=30", false, false);
    assertEquals("<prereq operator=\"GTEQ\" operand=\"30\" >\n" + "<prereq kind=\"skill\" total-values=\"true\" key=\"Spot\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "<prereq kind=\"skill\" total-values=\"true\" key=\"Listen\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "<prereq kind=\"skill\" total-values=\"true\" key=\"Search\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "</prereq>\n", prereq.toString());
}
Also used : PreSkillTotalParser(plugin.pretokens.parser.PreSkillTotalParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 4 with PreSkillTotalParser

use of plugin.pretokens.parser.PreSkillTotalParser in project pcgen by PCGen.

the class PreSkillTotRoundRobin method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    TokenRegistration.register(new PreSkillTotalParser());
    TokenRegistration.register(new PreSkillWriter());
}
Also used : PreSkillWriter(plugin.pretokens.writer.PreSkillWriter) PreSkillTotalParser(plugin.pretokens.parser.PreSkillTotalParser)

Aggregations

PreSkillTotalParser (plugin.pretokens.parser.PreSkillTotalParser)4 Test (org.junit.Test)3 Prerequisite (pcgen.core.prereq.Prerequisite)3 PreSkillWriter (plugin.pretokens.writer.PreSkillWriter)1