title: c#: Writing a test for this use case
body: <p>I want to check if the users password has been changed, what is the best way to write this test? Is my code in need of refactoring because it is wrong?</p>
  
  <p>Inside the code password.ResetUserPassword - I find out which user is requesting a password change, if they can change, and generating an email if needs to be... Do I need to pass in a <code>User</code> objects to this method? This logic is called by my controller (or backend if needs to be)</p>
  
  <pre><code>    [Test]
      public void Test_If_New_Password_Is_Generated_For_User()
      {
          var repo = new ReadOnlySession();
          var update = new UpdateSession();
  
          var passwordService = new UserPasswordService();
          var password = new AccountProfileProcessor(repo, update, passwordService);
  
          password.ResetUserPassword("companyid", "jon.smithers", null);
  
          Assert.Pass();
  
      }
  </code></pre>
  
  <p>//The method that I am calling</p>
  
  <p>_<code>passwordService</code> is a service that handles generating a new key for the user</p>
  
  <pre><code>    public void ResetUserPassword(string identifier, string loginid, string passwordreseturl)
      {
          //get user object
          var currentUser = _readOnlySession.All&lt;User&gt;()
              .Where(x =&gt; x.Login == loginid)
              .SingleOrDefault(); //any other logic to get user resides here...
  
          if (currentUser == null)
              throw new UserNotFoundException();
  
          _passwordService.ResetPassword(currentUser.User, identifier, loginid);
  
          //persist data
          _updateSession.Update(currentUser.User);
  
          //send out email with the url as a link inside the email
      }
  </code></pre>