title: Google Mock unit testing static methods c++
body: <p>I just started working on unit testing (using BOOST framework for testing, but for mocks I have to use Google Mock) and I have this situation : </p>
  
  <pre><code>class A
  {
  static int Method1(int a, int b){return a+b;}
  };
  
  class B
  {
  static int Method2(int a, int b){ return A::Method1(a,b);}
  };
  </code></pre>
  
  <p>So, I need to create mock class A, and to make my class B not to use real Method1 from A class, but to use mock.</p>
  
  <p>I'm not sure how to do this, and I could not find some similar example.</p>