So I'm writing a cache system (not too complicated, but it has very nice semantics) with a ttl (time to live) for items.
Of course the ttl must be unit tested, but since one can't inject a new implementaton of "IDateTime" or "ITimeSpan" in C# (because there is no such thing), how would you go about that?
Write a new component "IDateTimeProvider" and "DateTimeProvider" first, which one can mockup then?
Isn't reimplementing parts of the .NET runtime library... overkill?
Edit: Thank you all for your amazing answers! I know now exactly what I'm going to do!