use of pcgen.core.Skill in project pcgen by PCGen.
the class GlobalAddedSkillCostFacetTest method testAddTwoSources.
@Test
public void testAddTwoSources() {
Skill t1 = getObject();
assertFalse(getFacet().contains(id, SkillCost.CLASS, t1));
getFacet().add(id, SkillCost.CLASS, t1, source1);
assertTrue(getFacet().contains(id, SkillCost.CLASS, t1));
assertFalse(getFacet().contains(id, SkillCost.CROSS_CLASS, t1));
//No cross pollution
assertFalse(getFacet().contains(altid, SkillCost.CLASS, t1));
PCClass source2 = new PCClass();
//Second add doesn't change anything
getFacet().add(id, SkillCost.CLASS, t1, source2);
assertTrue(getFacet().contains(id, SkillCost.CLASS, t1));
assertFalse(getFacet().contains(id, SkillCost.CROSS_CLASS, t1));
//No cross pollution
assertFalse(getFacet().contains(altid, SkillCost.CLASS, t1));
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class GlobalAddedSkillCostFacetTest method testTypeRemoveUselessSource.
@Test
public void testTypeRemoveUselessSource() {
Skill t1 = getObject();
assertFalse(getFacet().contains(id, SkillCost.CLASS, t1));
getFacet().add(id, SkillCost.CLASS, t1, source1);
assertTrue(getFacet().contains(id, SkillCost.CLASS, t1));
PCClass source2 = new PCClass();
getFacet().remove(id, SkillCost.CLASS, t1, source2);
assertTrue(getFacet().contains(id, SkillCost.CLASS, t1));
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class GlobalAddedSkillCostFacetTest method testTypeAddMultRemove.
@Test
public void testTypeAddMultRemove() {
Skill t1 = getObject();
Skill t2 = getAltObject();
assertFalse(getFacet().contains(id, SkillCost.CLASS, t1));
getFacet().add(id, SkillCost.CLASS, t1, source1);
assertFalse(getFacet().contains(id, SkillCost.CLASS, t2));
assertTrue(getFacet().contains(id, SkillCost.CLASS, t1));
getFacet().add(id, SkillCost.CLASS, t2, source1);
assertTrue(getFacet().contains(id, SkillCost.CLASS, t1));
assertTrue(getFacet().contains(id, SkillCost.CLASS, t2));
getFacet().remove(id, SkillCost.CLASS, t1, source1);
assertFalse(getFacet().contains(id, SkillCost.CLASS, t1));
assertTrue(getFacet().contains(id, SkillCost.CLASS, t2));
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class GlobalAddedSkillCostFacetTest method getObject.
protected Skill getObject() {
Skill t = new Skill();
t.setName("Skill" + n++);
return t;
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class LocalAddedSkillCostFacetTest method testAddNullSource.
@Test
public void testAddNullSource() {
Skill t1 = getObject();
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t1));
getFacet().add(id, class1, SkillCost.CLASS, t1, null);
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t1));
assertFalse(getFacet().contains(id, class1, SkillCost.CROSS_CLASS, t1));
//No cross pollution
assertFalse(getFacet().contains(id, class2, SkillCost.CLASS, t1));
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, getObject()));
assertFalse(getFacet().contains(altid, class1, SkillCost.CLASS, t1));
}
Aggregations