ios - Testing and asynchronous NSURLConnection request's response with Xcode -



ios - Testing and asynchronous NSURLConnection request's response with Xcode -

i'd take advantage of testing classes , methods in xcode check responses receive several asynchronous http services requests app does, in order see if receive , parse correctly expected parameters.

responses receive in json format, , app parses them create custom objects. phone call services means of object makes utilize of nsurlconnection connection , implements nsurlconnectiondelegate protocol responses. don't find way test this, since conforming xctestcase class nsurlconnectiondelegate protocol not seem work.

thanks

i suggest going kind of test incorrectly.

using live data, , performing fetch on network isn't testing. want test parsing of returned data.

one approach utilize stubbing framework such ohhttpstubs or nocilla.

in way can load json files , test parsing, or test different conditions such poor networks, or network errors.

this provides controlled environment in perform tests , much improve thought performing fetch.

another advantage can write code against tests while commuting , without net connection :)

ios xcode unit-testing nsurlconnection nsurlconnectiondelegate

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -