title: ExpectedException not catching exception, but I can catch it with try catch
body: <p>Any ideas on this one? I'm trying to write a unit test that will delete an item and confirm that item is no longer in a repository by trying to retrieve the item by its ID which should throw a DataAccessException. However, the test keeps failing. I added a try catch block and sure enough I caught the exception I was expecting. I'm using VS Test Tools for unit testing.</p>
  
  <pre><code>    [ExpectedException(typeof(DataAccessException))]
      private static void NHibernateRepositoryBaseDeleteHelper&lt;T, TKey&gt;(T myItem, TKey myItemId)
      {
          MyTestRepository&lt;T, TKey&gt; myRepository = new MyTestRepository&lt;T, TKey&gt;();
          myRepository.Delete(myItem);
          myRepository.CommitChanges();
          try
          {
              myRepository.GetById(myItemId, false);
          }
          catch (DataAccessException dae)
          {
              Assert.IsTrue(true);
          }
      }
  </code></pre>