Quantcast
Channel: Telerik Blogs
Viewing all articles
Browse latest Browse all 5210

30 Days of TDD – Day 27 – Reader Question #3

$
0
0
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?

Viewing all articles
Browse latest Browse all 5210

Trending Articles