title: Automatic generation of mock classes for gmock
body: <p>I am using <strong>gmock</strong> for <strong>unit testing C++ code</strong>. I am not using the <strong>gtest framework</strong>. I am using visual studio 2008's built-in testing framework.</p>
  
  <p>Now my problem is that I have to manually write mock classes for a real class to unit test. For example if I have A class with 5 functions then I have to write MockAClass with 5 functions. Is there any way that these classes are automatically generated.</p>
  
  <pre><code>class AClass
  {
  public:
      virtual int AFunction()
      {
          return 5;
      }
      virtual int AFunctionWithArguments(int x)
      {
          return x;
      }
  
  
  
  class MockAClass : public AClass
  {
  public:
      MOCK_METHOD0(AFucntion, int());
      MOCK_METHOD1(AFunctionWithArgument, int(int x));
  };
  </code></pre>