Constraint c1 = (Constraint) mockC1.proxy();
Constraint c2 = (Constraint) mockC2.proxy();
Constraint c3 = (Constraint) mockC3.proxy();
public void testAndAllChildrenConstraintsTrueGivesTrue() {
Constraint c = new And(c1, c2, c3);
mockC1.expects(once()).method("evaluate")
.with(same(adapter))
.will(returnValue(Boolean.TRUE)).id("c1");
mockC2.expects(once()).method("evaluate")
.with(same(adapter)).after(mockC1, "c1")
.will(returnValue(Boolean.TRUE)).id("c2");
mockC3.expects(once()).method("evaluate")
.with(same(adapter)).after(mockC2, "c2")
.will(returnValue(Boolean.TRUE));
assertTrue(c.evaluate(adapter));
}