|
From: <st...@m3...> - 2003-02-07 13:42:55
|
> How about changing the interface of IConstraint (is this the kind of=20
> thing you meant with the TestValue approach?).
> To:
>=20
> interface IConstraint {
> bool Eval(object actual);
> string Message(object actual);
> }
>=20
> The LastValue suggestion doesn't quite feel right. Could make=20
> IConstraints harder to implement (they're very clean at the moment) and=
=20
> could get confusing if reusing constraints.
I hadn't thought of that, but it does mean that the constraint gets to writ=
e 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 b=
e refactored to use it as well (once and only once) -- I think we might get=
some reuse out of that.
S.
|