Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cbess/cbasynctestcase

ObjC Easy Asynchronous Unit Test Case - Synchronize those async operations for testing purposes
https://github.com/cbess/cbasynctestcase

Last synced: about 1 month ago
JSON representation

ObjC Easy Asynchronous Unit Test Case - Synchronize those async operations for testing purposes

Awesome Lists containing this project

README

        

CBAsyncTestCase
===============

Asynchronous Unit Test Case - Synchronize those async operations for testing purposes.

#### Example Usage

```objc
- (void)testNetworkStuff
{
[self beginAsyncOperation];

NSString *identifier = @"777";
[_networkManager fetchStuffWithID:identifier completion:^(NSArray *results, NSError *error) {

STAssertNil(error, @"error occurred: %@", error);
STAssertTrue(results.count, @"no results");

[self finishedAsyncOperation];
}];

// waits for async operation or timeout and fail assertion
[self assertAsyncOperationTimeout];
}
```