[feedhenry-dev] Mock libraries to use for unit test for Swift iOS SDK

Timur Tatarshaov timur at redhat.com
Tue Mar 8 07:45:06 UTC 2016


As we develop unit tests for fh-ios-swift-sdk we need to evaluate which
mock libraries to use.

1. Mock http
For fh-ios-sdk (ObjC) we used to work with Nocilla to dynamic mock (through
swizzling) the HTTP layer.
For aerogear-ios-http (one of the lib we're going to use in
 fh-ios-swift-sdk), we mocked HTTP layer with OHHTTPStubs. Nocilla was
picked for FH sdk over OHHTTPStubs because it supports ASIHTTP lib, but
since we're now working with plain NSURLSession, we could unify the libs to
use.

2. dynamic Mock
in ObjC we used to work with OCMock (dynamic mock), in Swift, with the
static type aspect of the language, mocks are done by implementing
protocol, more "hand crafted". But still libraries like the one written by
Tadeas are worth investigating:
https://github.com/SwiftKit/Cuckoo

3. BDD style
Evaluate if BDD libs like Quick/Nimble could help writing test that read
nicely
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/feedhenry-dev/attachments/20160308/4d31df60/attachment.htm>


More information about the feedhenry-dev mailing list