|
From: Nat P. <nat...@b1...> - 2003-08-27 09:59:41
|
From: "Francois Beausoleil" <fb...@us...>
> I believed that with the regular Mock I could setup values to be returned
> from each methods, and that the values would be put in a List of some
> kind. That is, the return values of each methods would be returned in
> order.
A regular mock does not guarantee that method invocationsare dispatched to
stubs/expectations in any order. A stub/expectation is found for an
invocation that matches the signature of the method and actual arguments of
the invocation. If you set up two expectations that both match the same
signature and actual arguments, they will *not* be executed in the order
that you set them up on the Mock. In fact, expectations that were specified
later should take precedence over those that were specified earlier,
although that behaviour might have been missing from v0.09. If you want to
stub or expect a sequence of calls you should create a CallSequence and add
it to the mock (or use an OrderedMock).
> OrderedMock on the other hand would expect the methods to be
> called in the order that the expectations were set.
That is correct.
> Is my understanding of the DynaMock framework correct ?
Not quite (see above).
> BTW, I forgot to say that this is terrific work ! I like the DynaMock
> API quite a bit.
Thanks.
Cheers,
Nat.
|