|
From: Steve F. <st...@m3...> - 2002-11-17 10:51:11
|
Thanks for your proposal in another message.
You might also consider combining the dynamic mock with a hand-rolled
mock using the ExpectationSet, e.g.
public void MockFoo extends Mock {
ExpectationSet values = new ExpectationSet("values);
public void addValue(Value aValue) { // override
values.addActual(aValue);
}
public void verify() {
super.verify();
values.verify();
}
}
The hand-coded addValue() method will be picked up before the dynamic
implementation.
S.
Barry Kaplan wrote:
> I'm trying to test methods that create sums by invoking other methods. I
> can setup the other methods correctly, but the setup of the mock method
> calls is always sensitive to the order in which they are called. For the
> method under test, this is not a requirement. Is there any mechanism for
> setting up a CallSequence to not care about the order, but still ensure
> that the total number of calls were made and the parameters were
> correct. (I suppose it might have to give each method a shot, and only
> fail if all fail to verify?)
|