I\'ve got some (C#) code that relies on today\'s date to correctly calculate things in the future. If I use today\'s date in the testing, I have to repeat the calculation in
Another one using Microsoft Moles (Isolation framework for .NET).
MDateTime.NowGet = () => new DateTime(2000, 1, 1);
Moles allows to replace any .NET method with a delegate. Moles supports static or non-virtual methods. Moles relies on the profiler from Pex.