title: HippoMock : mocking just a part of class
body: <p>I would like to know if with HippoMock it is possible to mock just a parts of a class.</p>
  
  <p>Example</p>
  
  <pre><code>class aClass
  {
  public:
      virtual void method1() = 0;
  
      void method2(){ 
          do
              doSomething;      // not a functon 
              method1();
          while(condition);
      };
  };
  </code></pre>
  
  <p>I would like to mock just method1 in order to test the method 2</p>
  
  <p>Clearly I use HippoMock and I have a bug in method2 so I made a unit test in order to correct it and be sure it will not come back. But i don't find the way to do it.</p>
  
  <p>I try this</p>
  
  <pre><code>TEST(testMethod2)
  {
      MockRepository mock;
      aClass *obj = mock.Mock&lt;aClass&gt;();
      mock.ExpectCall(obj , CPXDetector::method1);
      obj-&gt;method2();
  }
  </code></pre>
  
  <p>Is there some solution in native cpp ? With an other mock framework ?</p>
  
  <p>Thanks a lot </p>
  
  <p>Ambroise Petitgenêt</p>