From: Nat P. <nat...@b1...> - 2002-11-19 17:10:16
|
On Tue, 2002-11-19 at 16:59, Barry Kaplan wrote: > > > That will certainly work. But I would rather not allow for the mistake > of a mismatch between class and object if possible. That would be checked when setupXXX or expectXXX is called. Any mismatch would result in an AssertionFailedError being thrown at that point. Mismatch at invocation time would be prevented by Java's type system. > That is why I wanted > Constraint to be responsible for providing the Class as it already knows > (once-and-only-once). Constraints are meant to provide flexibility. E.g. there is an IsAnything constraint for when your test doesn't care about actual values. Also, Constraints are invoked *after* the static type system and runtime type checking in the Reflection API has checked that types are correct, so there is no need for Constraints to specify more about types than is actually needed for the test. Cheers, Nat. -- Nat Pryce <nat...@b1...> B13media |