iphone - How to unit tests functions which return results asyncronously in XCode? -


I have something like

  - (zero) getData: (SomeParameter *) param {// Remotely calls for data returned data via a remote method -} (zero) handleDataDidet method: (NSDT *) data {// handle data returned}  

I want to write a unit test for this, how can I do something better than data returned from

  NSData * = zero; - (zero) handleDateDataData: (NSDTA *) data {returnData = data; } - (zero) test {[obj getData: param]; While (returned!) {[Entrad gold: 1]; } // Tested on Returned Data    

  1. Your object Get the getData: method to call a counterfeit and check that it calls correctly.

  2. Call HandleDeliget Method: Another test method with some ready-baked data and ensures that whatever data it has given Is done with.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -