Beispiel #1
0
 @Test
 public void testGetFromRace() {
   Race r = new Race();
   r.put(IntegerKey.CREATURE_HANDS, 5);
   rfacet.set(id, r);
   assertEquals(5, facet.getHands(id));
   rfacet.remove(id);
   assertEquals(0, facet.getHands(id));
 }
Beispiel #2
0
 @Test
 public void testGetFromTemplate() {
   rfacet.set(id, new Race());
   PCTemplate t = new PCTemplate();
   t.put(IntegerKey.CREATURE_HANDS, 5);
   tfacet.add(id, t, this);
   assertEquals(5, facet.getHands(id));
   tfacet.remove(id, t, this);
   assertEquals(2, facet.getHands(id));
 }
Beispiel #3
0
 @Override
 public void setUp() throws Exception {
   facet = new HandsFacet();
   super.setUp();
   DataSetID cid = DataSetID.getID();
   id = CharID.getID(cid);
   altid = CharID.getID(cid);
   facet.setRaceFacet(rfacet);
   facet.setTemplateFacet(tfacet);
 }
Beispiel #4
0
 @Test
 public void testAvoidPollution() {
   Race r = new Race();
   r.put(IntegerKey.CREATURE_HANDS, 5);
   rfacet.set(id, r);
   assertEquals(0, facet.getHands(altid));
 }
Beispiel #5
0
 @Test
 public void testGetFromTemplateSecondOverrides() {
   Race r = new Race();
   r.put(IntegerKey.CREATURE_HANDS, 5);
   rfacet.set(id, r);
   assertEquals(5, facet.getHands(id));
   PCTemplate t = new PCTemplate();
   t.setName("PCT");
   t.put(IntegerKey.CREATURE_HANDS, 3);
   tfacet.add(id, t, this);
   assertEquals(3, facet.getHands(id));
   PCTemplate t5 = new PCTemplate();
   t5.setName("Other");
   t5.put(IntegerKey.CREATURE_HANDS, 4);
   tfacet.add(id, t5, this);
   assertEquals(4, facet.getHands(id));
   tfacet.remove(id, t, this);
   assertEquals(4, facet.getHands(id));
   tfacet.add(id, t, this);
   assertEquals(3, facet.getHands(id));
   tfacet.remove(id, t, this);
   assertEquals(4, facet.getHands(id));
   tfacet.remove(id, t5, this);
   assertEquals(5, facet.getHands(id));
 }
Beispiel #6
0
 @Test
 public void testWithNothingInRaceDefault2() {
   rfacet.set(id, new Race());
   assertEquals(2, facet.getHands(id));
 }
Beispiel #7
0
 @Test
 public void testRaceTypeUnsetNull() {
   assertEquals(0, facet.getHands(id));
 }