1

I tried OCUnit, GTM, and iUnitTest but none of them supports testing for asynchronous methods. How do you test asynchronous methods on iPhone?

fish potato
  • 5,319
  • 6
  • 27
  • 32

2 Answers2

2

Have you tried making a local runloop in the test case?

Here you can have the test case wait for completion of the asynchronous call and possibly perform some timout checks.

Claus Broch
  • 9,212
  • 2
  • 29
  • 38
0

Consider this answer to a different stackoverflow question: Testing asynchronous code on iOS with OCunit

Community
  • 1
  • 1
ThomasW
  • 16,981
  • 4
  • 79
  • 106