Comments on: Testing DateTime.Now https://www.limilabs.com/blog/testing-datetime-now Using Limilabs .net components Tue, 02 Feb 2010 07:16:47 +0000 hourly 1 https://wordpress.org/?v=6.6.2 By: Chris Missal https://www.limilabs.com/blog/testing-datetime-now#comment-1431 Tue, 02 Feb 2010 07:16:47 +0000 http://www.limilabs.com/blog/?p=480#comment-1431 Moles can intercept static methods like DateTime.Now (like TypeMock Isolator), but you’re better off abstracting it so you don’t have to rely on those tools. It will just make your code more robust if you can design it without those tools.

This is a fine example and there are others too that all you to work with DateTime without relying on the static Now property.

]]>
By: Limilabs support https://www.limilabs.com/blog/testing-datetime-now#comment-1430 Tue, 02 Feb 2010 06:36:19 +0000 http://www.limilabs.com/blog/?p=480#comment-1430 1. You need to have Pex installed.
2. Is it simple to revert Mole to the original behavior?
3. Does it happen automatically?

]]>
By: Tomasz Wisniewski https://www.limilabs.com/blog/testing-datetime-now#comment-1429 Mon, 01 Feb 2010 17:03:40 +0000 http://www.limilabs.com/blog/?p=480#comment-1429 It is easier to use Moles (http://research.microsoft.com/en-us/projects/moles/) from MS RiS, which are part of Pex (http://research.microsoft.com/en-us/projects/pex/)

]]>