From: Barry K. <bk...@in...> - 2003-08-22 13:26:48
|
(Steve) As part of the latest DM overhual, is the issue of performing some validation (ie, fail fast) of expectations? For example, given: public interface Foo { public void bar(Blob blob); } ... // 1. no method tweetle on interface mockFoo.expect("tweetle", aBlob); // 2. no bar method that takes two arguments mockFoo.expect("bar", C.args(C.eq(aBlob), C.eq(aTweetle))); // 3. no bar method that returns a Tweetle mockFoo.expectAndReturn("bar", aBlob, aTweetle); // 4. no bar method that takes a Tweetle argument mockFoo.expect("bar", C.eq(aTweetle)); ---- 1, 2, 3 /could/ be done with the current design. It just isnt' resulting strange test executions that could have failed immediatly at setup time. 4 would require some method of "knowing" a constraint's type. That is the type of its argument. Of course this may not always be possible, but when it is could be used to help validate the expectations. -bk |