Hi,
I have a strange problem with DateTime.Now. When I Run simple test:
[Test, Isolated]
public void DateTimeNow_Test()
{
DateTime fakedDate = new DateTime(2009, 12, 1);
Isolate.WhenCalled(()=>DateTime.Now).WillReturn(fakedDate);
Assert.AreEqual(new DateTime(2009,12,1),DateTime.Now);
}
I get exception: TypeMock.TypeMockException:
*** No method calls found in recording block. Please check:
* Are you trying to fake a field instead of a property?
* Are you are trying to fake mscorlib type?
I've locally installed TM 5.4.5 and I add TypeMock and TypeMock.ArrangeActAssert dll's into my project. Previously I had installed older TM version - I started with 5.3.1 but never have to mock DateTime.Now. I read on forum that someone has the same problem after upgrading TM to 5.3.5 version but I don't see any solution.
Do you have any experience with this problem? How to check which TM version is really use during tests execution? Any idea would be nice.
br
tlucz