title: OCMock a Class method to call back the passed block with custom Data
body: <p>I do have a class that handles all my network communication like this:</p>
  
  <pre><code>typedef void (^ networkEndblock) (NSArray *, NSError *);
  
  @interface NetworkAPI : NetworkBase
  
  + (void) doSomeNetworkAcion:(networkEndblock) endBlock;
  
  @end
  </code></pre>
  
  <p>I use the above code like this (I do not want to get into irrelevant details here) </p>
  
  <pre><code>- (void) runMyProcess:(SomeEndBlock)proccesEnded{
  
    // Bussiness logic
  
  
    // Get Data from the web
    [NetworkAPI doSomeNetworkAcion:^(NSArray *resultArray, NSError *error){
  
     // Check for error. if we have error then do error handling
     // If no error, check for array.
     // If array is empty then go to code that handles empty array
     // else Process data                                 
  
     }];
  }
  </code></pre>
  
  <p>In my test method I want to trigger runMyProcess to test, I do not want it to go and hit the network, I want to control that and set cases to make it return an error, empty array ...etc. I know how to use SenTest and it is MACROS but I do not how to fake my network API.</p>
  
  <p>I looked into stubs and expect but I got confused if I can do what I want.</p>
  
  <p>Thanks</p>