When unit testing asynchronous code like a completion handler, we could end up with false positives in case we just add some assert in the completion block. A better strategy is shown in the following sample. We will eliminate the false positive by the use of the waitForExpectations function.
Some bugs only popup or become visible when the users have a very bad connection. Luckily for us iOS developers, there is an easy solution to simulate this kind of issues.
18 post articles, 3 pages.