AGAsyncTestHelper
C Macro for writing unit tests with asynchronous operations. Works perfectly with SenTestingKit!
Example blocks
- (void)testDoSomeOperation
{
__block BOOL jobDone = NO;
[Manager doSomeOperationOnDone:^(id data) {
jobDone = YES;
}];
WAIT_WHILE(!jobDone, 2.0);
}
WAIT_WHILE() will stall current runloop while !jobDone is TRUE and throw an STFail if exceeding time limit (2.0 seconds).
GitHub
C Macro for writing unit tests with asynchronous operations. Works perfectly with SenTestingKit!
Example blocks
- (void)testDoSomeOperation
{
__block BOOL jobDone = NO;
[Manager doSomeOperationOnDone:^(id data) {
jobDone = YES;
}];
WAIT_WHILE(!jobDone, 2.0);
}
WAIT_WHILE() will stall current runloop while !jobDone is TRUE and throw an STFail if exceeding time limit (2.0 seconds).
GitHub
Comments
Post a Comment