Example #1
0
 @Test
 @Given("model;newChildB")
 public Leaf numberPropertyB(Repository m, Leaf b) {
   assertEquals(0, b.count);
   assertEquals((Integer) 0, m.read("count", b));
   m.write("count", b, 23);
   assertEquals(23, b.count);
   assertEquals((Integer) 23, m.read("count", b));
   return b;
 }
Example #2
0
 @Test
 @Given("model;newChildA")
 public Leaf numberPropertyA(Repository m, Leaf a) {
   assertEquals((Integer) 0, (Integer) a.count);
   assertEquals((Integer) 0, (Integer) m.read("count", a));
   m.write("count", a, 42);
   assertEquals(42, a.count);
   assertEquals((Integer) 42, (Integer) m.read("count", a));
   return a;
 }
Example #3
0
 @Test
 @Given("model;newParent;newChildA;newChildB;parentChildrenAreOpposite")
 public Container parentWithChildren(Repository m, Container p, Leaf a, Leaf b) {
   assertEquals(0, p.children.size());
   assertEquals(null, a.parent);
   assertEquals(null, b.parent);
   m.write("children", p, a, b);
   assertEquals(2, p.children.size());
   assertEquals(p, a.parent);
   assertEquals(p, b.parent);
   return p;
 }