title: Unit Tests run too fast when run in groups caused by the 'System.DateTime' accuracy
body: <p>I am running a nice big list of unit tests which are checking various different class gets and sets. I have come across a bit of a bug in that my tests run <strong>too fast</strong>?!?</p>
  
  <p>As a quick example, the unit tests start by mocking a blog with a comment;</p>
  
  <pre><code>Blog b = new Blog("Comment");
  </code></pre>
  
  <p>This sets the DateTime added of the new comment in the blog. I am then testing the addition of a comment to the blog;</p>
  
  <pre><code>b.addComment(comment);
  </code></pre>
  
  <p>At the end of the test I am asserting the addition of the test using the following;</p>
  
  <pre><code>Assert.AreEqual(x, b.Comments.OrderByDescending(x =&gt; x.CreatedDate).First().Comment;
  </code></pre>
  
  <p>As it stands this passes when run in isolation. However when the test is run in a group of tests this will fail because both comments have the exact same DateTime. It's worth noting the the following will pass only because it will be ordered by the default ordering;</p>
  
  <pre><code>Assert.AreEqual(x, b.Comments.OrderBy(x =&gt; x.Created).Last().Comment;
  </code></pre>
  
  <p>My initial thought was how the hell can it fail? The DateTime.Utc has a <code>ticks</code> function which is accurate to like a millionth of a second. after some research I found out that the system date time is only precise to 10-15ms so this is my issue.</p>
  
  <h2>My question is, whats the best solution?</h2>
  
  <p>I could add <code>Thread.Sleep(20);</code> to every test but if I run 1000 tests that's now 20 seconds? How have other people got round this issue?</p>