My question is the same as Mockito: Mock private field initialization but for Google Mock framework. In a nutshell:
class Target {
private:
Person person = new Person();
public:
void testMethod() {
person.someMethod();
}
};
How can I mock the person
instance while making unit tests for Target
class?