title: Moq unit test with It.IsAny<DateTime>() fails
body: <p>I'm using Moq to write the unit tests for a project, and one of the tests is failing when I try to verify that a DateTime property is assigned a value. Here's my Verify (which fails):</p>
  
  <pre><code>        _mockTaskContext.Verify(context =&gt; context.TaskQueue.AddObject(It.Is&lt;TaskQueueItem&gt;(
              task_queue =&gt; task_queue.TaskCode == (int)TaskCode.MyTask
                      &amp;&amp; task_queue.ClientID == ExpectedClientID
                      &amp;&amp; task_queue.JobNumber == It.IsAny&lt;int&gt;()
                      &amp;&amp; task_queue.Requester == String.Empty
                      &amp;&amp; task_queue.JobStatus == (int)JobStatus.Submitted
                      &amp;&amp; task_queue.TimeQueued == It.IsAny&lt;DateTime&gt;()
                      &amp;&amp; task_queue.TimeStarted == new DateTime(1900, 1, 1)
                      &amp;&amp; task_queue.TimeStopped == new DateTime(1900, 1, 1)
                      &amp;&amp; task_queue.TaskParameters == expectedTaskParam
              )), Times.Once());
  </code></pre>
  
  <p>If I comment out the expectation on <code>task_queue.TimeQueued</code> then the test passes, without making any other changes to my test. Also, if I change the requirement on either <code>TimeStarted</code> or <code>TimeStopped</code> from <code>new DateTime(1900, 1, 1)</code> to <code>It.IsAny&lt;DateTime&gt;()</code>, the test fails. I've run the code under test outside the unit test with the actual implementation instead of a mocked repository, and <code>TimeQueued</code> is being assigned its value correctly. Any idea why <code>It.IsAny</code> doesn't seem to work correctly for <code>DateTime</code> properties, or am I setting up my expectations incorrectly?</p>
  
  <p>Update: I'm using It.IsAny() in other tests without any problem, but this test is still failing. I think it might be because this is inside the It.Is lambda expression, but I don't know how I would work around that.</p>