Created
July 12, 2012 08:02
-
-
Save atnan/3096563 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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