[LRUG] A question on DRYness on testing methods that get / set state

Tom Stuart tom at experthuman.com
Tue Nov 22 03:29:25 PST 2011


On 22 Nov 2011, at 11:23, Tim Cowlishaw wrote:
> I guess this is a bit of a tradeoff, but I'd be curious to know - how
> do you guys write tests for methods that get or set state? is there a
> better way than the above?

Spec behaviour, not implementation. I'd have a single example that covers the behaviour "when I put a value, get should return that value".

Cheers,
-Tom


More information about the Chat mailing list