开发者

GHUnit for Integration Testing iOS Network functions

I have an iOS application (but this is just as applicable to an OS X app) that has async network access functions. Using GHUnit and without manually doing inner run loops, or synchronization of async operations, is it possible have a test method run an async operation and verify the results AFTER the async operation is complete.

I don't see anything in GHUnit to allow this but I might be blind. I do know of people who do this with inner run loops, but I have a bunch of integration tests and don't want to set this 开发者_JAVA百科up for each test.


I just stumbled into the same problem (and blog post, which contains some key pieces filtered due to comparison operators).

You're looking for GHAsyncTestCase within GHUnit. The example in the description does a better job than I'd be able to do.


The GHUnit async example shows you how to setup, but does not run any tests after the async operation is completed.

The trick to do it is to call the asserts AFTER waitForStatus.

An example here: http://samwize.com/2012/11/25/create-async-test-with-ghunit/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜