title: How to make a unit test mock of an object with non-virtual functions
body: <p>I have a C# class that gets generated using the wsdl.exe tool that looks something like this:</p>
  
  <pre><code>public partial class SoapApi : System.Web.Services.Protocols.SoapHttpClientProtocol
  {
      public SOAPTypeEnum AskServerQuestion()
      {
          object[] results = return this.Invoke("AskServerQuestion");
          return (SOAPTypeEnum) results[0];
      }
  }
  </code></pre>
  
  <p>I have some thin wrapper code around this that keeps track of the result, etc.  Is it possible to use any of the object mocking frameworks to make a fake SoapApi class and return predictable results for each of the calls to the thin wrapper functions?</p>
  
  <p>I can't make the AskServerQuestion() function virtual because it's auto-generated by the wsdl.exe tool.</p>