|
From: Joe W. <jo...@tr...> - 2003-02-07 15:42:02
|
st...@m3... wrote:
>>How about changing the interface of IConstraint (is this the kind of
>>thing you meant with the TestValue approach?).
>>To:
>>
>> interface IConstraint {
>> bool Eval(object actual);
>> string Message(object actual);
>> }
>>
>>The LastValue suggestion doesn't quite feel right. Could make
>>IConstraints harder to implement (they're very clean at the moment) and
>>could get confusing if reusing constraints.
>>
>>
>
>I hadn't thought of that, but it does mean that the constraint gets to write the message, whereas that's really the job of the assertion (c.f. all the trouble with the new JUnit string compressor). I'd be more inclined to go with the TestValue() option, not least of which because the Eval code can be refactored to use it as well (once and only once) -- I think we might get some reuse out of that.
>
>
I'm not getting the TestValue option. Could you provide an example...
-Joe
|