From: Frederic D. <fre...@ac...> - 2003-09-23 10:12:05
|
Hi all, I must confess I haven't thoroughly searched through either Wiki, the lists or the source code (Flame disclaimer :) ) Is there a way to create a mock with a default 'I don't care' behaviour for most of the methods? What I mean is that, for some tests, there might be a bunch of methods called, for which I don't want to set expectations (because sometimes I don't know which methods will be called, how many times, ..., or if the mock-proxy is temporarily handled to an outside object for which I don''t have the source code, or I just don't care to provide an 'implementation' (hashcode, toString, ..)). For those methods, I'd just like to set a global default behaviour: - match any call, with any args (or no args) - return a default value (true or false for boolean, 0 for numeric values, null for objects) (with this default value that could be changed). but still to be able to set expectations on methods I care. In the same way, is there a way to say "this method will be called, I don't care how many times, just return always this value" ? Thanks!! Regards Frederic |