Example #1
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));
 }
Example #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));
 }