title: How to Google Mock a method called from a struct
body: <p>Let's have this example:</p>
  
  <pre><code>    Class A{
           public:
             int Get();
     }
  </code></pre>
  
  <p>In another file:</p>
  
  <pre><code>A a;
  struct B{
      int res = a.Get(); 
  }
  </code></pre>
  
  <p>I would need to Google Mock Get method, however, I will also need to call the real one. I have tried with #ifdef, and it seems to work. Then I decided to mock it in the #ifdef section but it does nothing.</p>
  
  <pre><code>#ifdef UNIT_TEST
  MOCK_METHOD0(A,Get);
  #else
  int A::Get(){....}
  #endif
  </code></pre>
  
  <p>What am I doing wrong? Is there any cleaner way to do it? Please, any help would be much appreciate it.</p>