Search in sources :

Example 6 with HitDie

use of pcgen.cdom.content.HitDie in project pcgen by PCGen.

the class HDTokenTest method testUnparseLegal.

@Test
public void testUnparseLegal() throws PersistenceLayerException {
    primaryProf.put(ObjectKey.LEVEL_HITDIE, new HitDie(1));
    expectSingle(getToken().unparse(primaryContext, primaryProf), "1");
}
Also used : HitDie(pcgen.cdom.content.HitDie) Test(org.junit.Test)

Example 7 with HitDie

use of pcgen.cdom.content.HitDie in project pcgen by PCGen.

the class HDTokenTest method testUnparseZero.

@Test
public void testUnparseZero() throws PersistenceLayerException {
    try {
        primaryProf.put(ObjectKey.LEVEL_HITDIE, new HitDie(0));
        assertBadUnparse();
    } catch (IllegalArgumentException e) {
    // Good here too :)
    }
}
Also used : HitDie(pcgen.cdom.content.HitDie) Test(org.junit.Test)

Example 8 with HitDie

use of pcgen.cdom.content.HitDie in project pcgen by PCGen.

the class HDTokenTest method testUnparseNegativeLevel.

@Test
public void testUnparseNegativeLevel() throws PersistenceLayerException {
    try {
        primaryProf.put(ObjectKey.LEVEL_HITDIE, new HitDie(-1));
        assertBadUnparse();
    } catch (IllegalArgumentException e) {
    // Good here too :)
    }
}
Also used : HitDie(pcgen.cdom.content.HitDie) Test(org.junit.Test)

Example 9 with HitDie

use of pcgen.cdom.content.HitDie in project pcgen by PCGen.

the class HitDieTokenTest method testUnparseZeroSteps.

@Test
public void testUnparseZeroSteps() throws PersistenceLayerException {
    try {
        primaryProf.put(ObjectKey.HITDIE, new HitDieStep(0, new HitDie(12)));
        assertBadUnparse();
    } catch (IllegalArgumentException e) {
    // Good here too :)
    }
}
Also used : HitDieStep(pcgen.cdom.processor.HitDieStep) HitDie(pcgen.cdom.content.HitDie) Test(org.junit.Test)

Example 10 with HitDie

use of pcgen.cdom.content.HitDie in project pcgen by PCGen.

the class HitDieTokenTest method testUnparseNegativeLevel.

@Test
public void testUnparseNegativeLevel() throws PersistenceLayerException {
    try {
        primaryProf1.put(ObjectKey.HITDIE, new HitDieLock(new HitDie(-1)));
        assertBadUnparse();
    } catch (IllegalArgumentException e) {
    // Good here too :)
    }
}
Also used : HitDieLock(pcgen.cdom.processor.HitDieLock) HitDie(pcgen.cdom.content.HitDie) Test(org.junit.Test)

Aggregations

HitDie (pcgen.cdom.content.HitDie)24 Test (org.junit.Test)14 HitDieLock (pcgen.cdom.processor.HitDieLock)9 HitDieStep (pcgen.cdom.processor.HitDieStep)6 PCClass (pcgen.core.PCClass)4 ParseResult (pcgen.rules.persistence.token.ParseResult)4 AddingFormula (pcgen.base.formula.AddingFormula)3 DividingFormula (pcgen.base.formula.DividingFormula)3 MultiplyingFormula (pcgen.base.formula.MultiplyingFormula)3 SubtractingFormula (pcgen.base.formula.SubtractingFormula)3 HitDieFormula (pcgen.cdom.processor.HitDieFormula)3 PCClassLevel (pcgen.cdom.inst.PCClassLevel)2 PlayerCharacter (pcgen.core.PlayerCharacter)2 ComplexParseResult (pcgen.rules.persistence.token.ComplexParseResult)2 CDOMObject (pcgen.cdom.base.CDOMObject)1 CharID (pcgen.cdom.enumeration.CharID)1 PCTemplate (pcgen.core.PCTemplate)1 SubClass (pcgen.core.SubClass)1 PCLevelInfo (pcgen.core.pclevelinfo.PCLevelInfo)1 HtmlInfoBuilder (pcgen.gui2.util.HtmlInfoBuilder)1