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: 4 months ago
JSON representation
ObjC Easy Asynchronous Unit Test Case - Synchronize those async operations for testing purposes
- Host: GitHub
- URL: https://github.com/cbess/cbasynctestcase
- Owner: cbess
- Created: 2013-06-30T03:26:40.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-06-30T03:40:20.000Z (about 12 years ago)
- Last Synced: 2025-01-17T04:45:29.993Z (6 months ago)
- Language: Objective-C
- Homepage:
- Size: 109 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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];
}
```