GithubHelp home page GithubHelp logo

abstractec / iltesting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from infiniteloopdk/iltesting

0.0 2.0 0.0 126 KB

Various helper classes to assist when testing for iOS and Mac OS X

Objective-C 80.68% C 19.32%

iltesting's Introduction

ILTesting

ILTesting provides a collection of Objective C helper classes primarily for assisting with testing. That is, if you can call the current content of one class a collection.

ILCannedURLProtocol

ILCannedURLProtocol is intended for unit and mock testing of code that makes http requests. It will intercept the standard http protocol and respond with a predefined set of test data every time the test is executed. This way any outside influences can be eliminated from the test results.

In order to use ILCannedURLProtocol, insert the following code in your test case before executing the code under test:

[NSURLProtocol registerClass:[ILCannedURLProtocol class]];
[ILCannedURLProtocol setCannedStatusCode:200];
[ILCannedURLProtocol setCannedHeaders:testHeaders];
[ILCannedURLProtocol setCannedResponseData:testData];

Make sure to unregister the ILCannedURLProtocol after each use:

[NSURLProtocol unregisterClass:[ILCannedURLProtocol class]];

See also:

ILProfilerCompat.c

This file provides a workaround for an error that sometimes occurs when enabling code coverage metrics on iOS using LLVM/Clang and libprofile_rt.dylib:

Detected an attempt to call a symbol in system libraries that is not present on the iPhone: fopen$UNIX2003 called from function llvm_gcda_start_file in image ...

To fix this problem simply include this file in your testing target build.


Feel free to add enhancements, bug fixes, etc. and provide them back to the community!

Thanks,

Claus Broch

iltesting's People

Contributors

infiniteloopdk avatar tibr avatar bjornsallarp avatar abstractec avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.