title: Unit Test for a Method that Changes the State of a private Field
body: <p>So, I have the following problem (using C#):</p>
  
  <p>I have two private fields in a class, one that saves the original state of a field and one that saves the updated state.</p>
  
  <p>I now want to write a method that basically takes the original state, copies it to the updated state and changes some of its content.</p>
  
  <p>So far I have implemented that as a void method which just changes the state of the fields (if needed). These fields will later be used by another method.</p>
  
  <p>I don't think I will have any trouble with the implementation, but I'm trying to write unit tests for this method (with MSTest) and can't see how I can properly test this.</p>
  
  <p>The thing I would really need to test is whether given the input parameters the content of the field has changed compared to its original state or not. Since both fields are private I can neither access the original state to set a value for the unit test nor can I access the fields to use for any comparisons for any assertions.</p>
  
  <p>The easiest way would be to expose all these fields with public properties, but I really have no use for public properties apart from the unit tests. Another way would be to rewrite the method to return the updated state, but that still doesn't help me in setting the original state to what I need for the tests.</p>
  
  <p>Any ideas or best practices on how to approach this?</p>