mockFoo.expects(once()).method("bar").with(eq(1)).will(returnValue(99));rather than, say
willare defined on our builder interfaces and chained on the same object. On the other hand,
returnValueare attached to the container—
MockObjectTestCase. One way to think of it is that our chained methods are keywords in our Domain-Specific Language, they're the fixed part of the language. The container methods represent values, points where users of the language can write their own extensions. In jMock, all these values are either a
Stub. We provide common implementations of these interfaces, but users can write their own to add a behaviour that is meaningful within the domain of their application.