Search in sources :

Example 6 with ChangeArmorType

use of pcgen.cdom.processor.ChangeArmorType in project pcgen by PCGen.

the class ArmortypeTokenTest method testUnparseSingle.

@Test
public void testUnparseSingle() throws PersistenceLayerException {
    primaryProf.addToListFor(ListKey.ARMORTYPE, new ChangeArmorType("Light", "Medium"));
    String[] unparsed = getToken().unparse(primaryContext, primaryProf);
    expectSingle(unparsed, "Light|Medium");
}
Also used : ChangeArmorType(pcgen.cdom.processor.ChangeArmorType) Test(org.junit.Test)

Example 7 with ChangeArmorType

use of pcgen.cdom.processor.ChangeArmorType in project pcgen by PCGen.

the class ArmortypeTokenTest method testUnparseNullSource.

@Test
public void testUnparseNullSource() throws PersistenceLayerException {
    try {
        primaryProf.addToListFor(ListKey.ARMORTYPE, new ChangeArmorType(null, "Medium"));
        assertBadUnparse();
    } catch (IllegalArgumentException e) {
    // Good here too :)
    }
}
Also used : ChangeArmorType(pcgen.cdom.processor.ChangeArmorType) Test(org.junit.Test)

Aggregations

ChangeArmorType (pcgen.cdom.processor.ChangeArmorType)7 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 TreeSet (java.util.TreeSet)1 Type (pcgen.cdom.enumeration.Type)1 MessageType (pcgen.core.utils.MessageType)1 ParseResult (pcgen.rules.persistence.token.ParseResult)1