use of pcgen.core.Skill in project pcgen by PCGen.
the class GlobalAddedSkillCostFacetTest method testTypeAddSingleTwiceRemove.
@Test
public void testTypeAddSingleTwiceRemove() {
Skill t1 = getObject();
assertFalse(getFacet().contains(id, SkillCost.CLASS, t1));
getFacet().add(id, SkillCost.CLASS, t1, source1);
assertTrue(getFacet().contains(id, SkillCost.CLASS, t1));
getFacet().add(id, SkillCost.CLASS, t1, source1);
assertTrue(getFacet().contains(id, SkillCost.CLASS, t1));
getFacet().remove(id, SkillCost.CLASS, t1, source1);
//Was added twice, but sources are a SET, removed once works
assertFalse(getFacet().contains(id, SkillCost.CLASS, t1));
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class LocalAddedSkillCostFacetTest 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 testAddSingleTwiceRemove.
@Test
public void testAddSingleTwiceRemove() {
Skill t1 = getObject();
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t1));
getFacet().add(id, class1, SkillCost.CLASS, t1, source1);
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t1));
getFacet().add(id, class1, SkillCost.CLASS, t1, source1);
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t1));
getFacet().remove(id, class1, SkillCost.CLASS, t1, source1);
//Was added twice, but sources are a SET, removed once works
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t1));
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class LocalAddedSkillCostFacetTest method testAddMultCostRemove.
@Test
public void testAddMultCostRemove() {
Skill t1 = getObject();
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t1));
getFacet().add(id, class1, SkillCost.CLASS, t1, source1);
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t1));
assertFalse(getFacet().contains(id, class1, SkillCost.CROSS_CLASS, t1));
getFacet().add(id, class1, SkillCost.CROSS_CLASS, t1, source1);
/*
* Note behavior here that it returns what is in the database, it does
* NOT attempt to "measure" SkillCost objects
*/
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t1));
assertTrue(getFacet().contains(id, class1, SkillCost.CROSS_CLASS, t1));
getFacet().remove(id, class1, SkillCost.CLASS, t1, source1);
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t1));
assertTrue(getFacet().contains(id, class1, SkillCost.CROSS_CLASS, t1));
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class GlobalAddedSkillCostFacetTest method testTypeAddSingleRemove.
@Test
public void testTypeAddSingleRemove() {
Skill t1 = getObject();
assertFalse(getFacet().contains(id, SkillCost.CLASS, t1));
getFacet().add(id, SkillCost.CLASS, t1, source1);
assertTrue(getFacet().contains(id, SkillCost.CLASS, t1));
getFacet().remove(id, SkillCost.CLASS, t1, source1);
assertFalse(getFacet().contains(id, SkillCost.CLASS, t1));
}
Aggregations