title: How to write a unit test for the methods that change data?
body: <p>I have the following method:</p>
  
  <pre><code>Void UpdateUser(User user){}
  </code></pre>
  
  <p>I need to check this method whether will work properly.</p>
  
  <p>I've used a separate db to check this in unit testing. But many experienced people said if I use this method that won't be unit testing; that's integration testing.</p>
  
  <p>But I don't know how to mock for unit testing.</p>
  
  <p>The code written in the <code>UpdateUser</code> method, will try to update data using Entity framework.</p>
  
  <p>If I mock (Actually I don't how to do this either), how this will work with entity framework?</p>