Originally posted by Stan James:
Have you built any multi-phase tests like the Music examples on fit.c2.com? They left the results of one fixture in a public static var and used it in the next fixture, which seemed a little tacky. We could at least use ThreadLocal to avoid collisions between users.
Yes - I think all my tests look like that - see
TestAbortTackle for an example.
You are right that using a static variable feels wrong - there is some discussion of the topic at the
fit-dev list under the subject "saving state between fixtures".
In much the same style, I'm thinking about a first fixture that can do a variety of database queries (all yielding a common set of columns) and a second one that will assert various things about the resultset. Does that sound reasonable?
Yes, it does. It's a common
pattern, currently known under a bunch of names - for example
Build Operate Check
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus