title: How to change the type of an assigned object with Google Mock?
body: <p>I want to check the behaviour of a method by testing a protected variable of an assigned object. Therefore, I want to inject a mock object for this assigned object. My problem is that this object is created during this method and is not given trough a parameter.</p>
  
  <pre><code>bool MappingConfigurationBuilder::buildMappingConfiguration(MappingConfiguration*&amp; mappingConfiguration)
  {
    ...
    ConfigurationForColor configurationForColor;
    buildConfigurationForColor(configurationForColor);
    mappingConfiguration = new MappingConfiguration(configurationForHeight, configurationForColor);
    ...
    return true;
  }
  </code></pre>
  
  <p>This method should create a ConfigurationForColor, change a protected variable on it in the protected method buildConfigurationForColor(...) and assign the object to a MappingConfiguration. I want to check the protected variable on configurationForColor. </p>
  
  <p>Can I use Google Mock to change the type of configurationForColor to a mock object?
  Or is their another possibility to test the protected variable?</p>