Skip to content

Instantly share code, notes, and snippets.

@atnan
Created July 12, 2012 08:02
Show Gist options
  • Save atnan/3096563 to your computer and use it in GitHub Desktop.
Save atnan/3096563 to your computer and use it in GitHub Desktop.
@implementation CSAccountTests
- (void)testGetAPIKeyWithValidCredentials {
[self testAsync:^{
CSAPI* validCredentialsAPI;
validCredentialsAPI = [[[CSAPI alloc] initWithSiteURL:kCSTestsValidSiteURL
username:kCSTestsValidUsername
password:kCSTestsValidPassword] autorelease];
[validCredentialsAPI getAPIKey:^(NSString* APIKey){
[self notifyTestFinished];
GHAssertNotNil(APIKey, nil);
} errorHandler:[self assertNoError]];
}];
}
@end
@implementation GHAsyncTestCase (CSConveniences)
- (void)testAsync:(void (^)(void))testBlock withTimeout:(NSTimeInterval)timeout {
[self prepare];
testBlock();
[self waitForStatus:kGHUnitWaitStatusSuccess timeout:timeout];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment