mirror of
https://github.com/zhigang1992/Progress-backup.git
synced 2026-01-12 16:33:13 +08:00
EventManager test
This commit is contained in:
1
Podfile
1
Podfile
@@ -5,6 +5,7 @@ platform :ios, '6.0'
|
||||
pod 'RDActionSheet', '~>0.0.1'
|
||||
pod 'AHAlertView', '~>0.0.2'
|
||||
pod 'GVUserDefaults', '~>0.9.0'
|
||||
pod 'SVProgressHUD', '~>0.9'
|
||||
|
||||
target :ProgressTests, :exclusive => true do
|
||||
pod 'GVUserDefaults', '~>0.9.0'
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
|
||||
- (NSArray *)reminderLists;
|
||||
|
||||
- (void)getReminderItemsInListWithIdentifier:(NSString *)listIdentifier includeCompleted:(BOOL)includeCompleted includeImcompleted:(BOOL)incluImcomple withCompletionBlock:(void (^)(NSArray *))completion;
|
||||
- (void)getReminderItemsInListWithIdentifier:(NSString *)listIdentifier includeCompleted:(BOOL)includeCompleted includeImcompleted:(BOOL)incluImcomple withCompletionBlock:(void (^)(NSArray *reminedrItems))completion;
|
||||
|
||||
@end
|
||||
|
||||
@@ -77,7 +77,7 @@ static PPEvenKitManager *_sharedManager;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)getReminderItemsInListWithIdentifier:(NSString *)listIdentifier includeCompleted:(BOOL)includeCompleted includeImcompleted:(BOOL)incluImcomple withCompletionBlock:(void (^)(NSArray *))completion{
|
||||
- (void)getReminderItemsInListWithIdentifier:(NSString *)listIdentifier includeCompleted:(BOOL)includeCompleted includeImcompleted:(BOOL)incluImcomple withCompletionBlock:(void (^)(NSArray *reminedrItems))completion{
|
||||
if ([self haveAccessToReminder]){
|
||||
if (!incluImcomple && !includeCompleted) {
|
||||
completion(nil);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
- (void)setUp{
|
||||
[super setUp];
|
||||
|
||||
}
|
||||
|
||||
- (void)tearDown{
|
||||
@@ -25,8 +24,34 @@
|
||||
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
|
||||
if (!success) {
|
||||
STFail(@"Don't have access to user's reminder");
|
||||
} else {
|
||||
STSuccess();
|
||||
}
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)testDefaultReminder{
|
||||
if (![[PPEvenKitManager sharedManager] defaultReminderListIdentifier] || [[[PPEvenKitManager sharedManager] defaultReminderListIdentifier] isEqualToString:@""] ) {
|
||||
STFail(@"No default reminder identifier");
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testReminderLists{
|
||||
NSArray *reminderLists = [[PPEvenKitManager sharedManager] reminderLists];
|
||||
if (reminderLists.count == 0) {
|
||||
STFail(@"0 Reminder lists");
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testGetReminderItemsAsync{
|
||||
[[PPEvenKitManager sharedManager] getReminderItemsInListWithIdentifier:[[PPEvenKitManager sharedManager] defaultReminderListIdentifier] includeCompleted:YES includeImcompleted:YES withCompletionBlock:^(NSArray *reminders) {
|
||||
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
|
||||
if (reminders == nil) {
|
||||
STFail(@"return nil reminder items");
|
||||
} else {
|
||||
STSuccess();
|
||||
}
|
||||
STSuccess();
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user