Recently, I\'ve begun to use Moq to unit test. I use Moq to mock out classes that I don\'t need to test.
How do you typically deal with static methods?
I liked Pose but couldn't get it to stop throwing InvalidProgramException which appears to be a known issue. Now I'm using Smocks like this:
Smock.Run(context => { context.Setup(() => DateTime.Now).Returns(new DateTime(2000, 1, 1)); // Outputs "2000" Console.WriteLine(DateTime.Now.Year); });