Adam Hall asks
Just a quick question regarding TDD, encapsulation and DateTime.Now()
I’ve often seen suggestions that you should control the behavior of DateTime.Now so that you can reliably test the way classes react to date times.
Controlling DateTime is a solution, but it smells of violating encapsulation, you are affecting objects from outside of their boundaries (and indeed system wide)
In your experience what is the best way to deal with Dates in TDD?
↧