How to unit test asynchronous methods in iOS using SenTestingKit

I’ve found the best way of unit testing asynchronous code in iOS using SenTestingKit (OCUnit) is by using a dispatch semaphore.

Here’s an example of how to use it:

What’s a dispatch semaphore? I’ve added some links below with explanations.

Related Links