{"action":"created","comment":{"url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/comments/51039851","id":51039851,"diff_hunk":"@@ -0,0 +1,240 @@\n+//\n+//  APCTasksReminderManagerTests.m\n+//  APCAppCore\n+//\n+//  Created by Michael L DePhillips on 1/26/16.\n+//  Copyright © 2016 Apple, Inc. All rights reserved.\n+//\n+\n+#import <XCTest/XCTest.h>\n+#import \"MockAPCTasksReminderManager.h\"\n+\n+static NSString* const kWalkingTaskReminder = @\"WalkingTaskReminder\";\n+static NSString* const kCardiacTaskReminder = @\"CardiacTaskReminder\";\n+static NSString* const kBalanceTaskReminder = @\"BalanceTaskReminder\";\n+\n+static NSString* const kWalkingName = @\"Walking Assessment\";\n+static NSString* const kCardiacName = @\"Cardiac Health Activity\";\n+static NSString* const kBalanceName = @\"Balance Assessment\";\n+\n+@interface APCTasksReminderManagerTests : XCTestCase\n+@property (nonatomic, strong) MockAPCTasksReminderManager* reminderManager;\n+@end\n+\n+@implementation APCTasksReminderManagerTests\n+\n+/** Put setup code here. This method is called before the invocation of each test method in the class. */\n+- (void) setUp\n+{\n+    [super setUp];\n+    \n+    self.reminderManager = [[MockAPCTasksReminderManager alloc] init];\n+    \n+    self.reminderManager.updatingRemindersRemovesAllLocalNotifications = YES;\n+    \n+    self.reminderManager.reminderTime = [APCTasksReminderManager reminderTimesArray][17]; // 17 = 5pm\n+    \n+    [self.reminderManager setReminderMessage:@\"Reminder Message\"\n+                             andDelayMessage:@\"Delay Reminder 1 Hour\"];\n+    \n+    [self.reminderManager handleActivitiesUpdateWithTodaysTaskGroups:@[]];\n+    \n+    APCTaskReminder *walkingAssessmentReminder = [[APCTaskReminder alloc] initWithTaskID:kWalkingTaskReminder reminderBody:kWalkingName];\n+    APCTaskReminder *cardiacHealthReminder = [[APCTaskReminder alloc] initWithTaskID:kCardiacTaskReminder reminderBody:kCardiacName];\n+    APCTaskReminder *balanceAssessmentReminder = [[APCTaskReminder alloc] initWithTaskID:kBalanceTaskReminder reminderBody:kBalanceName];\n+    \n+    [self.reminderManager setReminderKey:kWalkingTaskReminder toOn:YES];\n+    [self.reminderManager setReminderKey:kCardiacTaskReminder toOn:YES];\n+    [self.reminderManager setReminderKey:kBalanceTaskReminder toOn:YES];\n+    \n+    [self.reminderManager setAllReminders:YES];\n+    \n+    self.reminderManager.tasksFullComplete = @{\n+                                               kWalkingTaskReminder : @(NO),\n+                                               kCardiacTaskReminder : @(NO),\n+                                               kBalanceTaskReminder : @(NO)};\n+    \n+    [self.reminderManager.reminders removeAllObjects];\n+    [self.reminderManager manageTaskReminder:walkingAssessmentReminder];\n+    [self.reminderManager manageTaskReminder:cardiacHealthReminder];\n+    [self.reminderManager manageTaskReminder:balanceAssessmentReminder];\n+}\n+\n+/** Put teardown code here. This method is called after the invocation of each test method in the class. */\n+- (void) tearDown\n+{\n+    [super tearDown];\n+}\n+\n+- (void) testRemindersTurnedOff\n+{\n+    [self.reminderManager setAllReminders:NO];\n+    [self.reminderManager updateTasksReminder];\n+    XCTAssertEqual(0, self.reminderManager.scheduledLocalNotification.count);\n+}\n+\n+- (void) testFphsSundayTuesdayNoneCompleteOnSaturday\n+{\n+    // Saturday\n+    self.reminderManager.mockNow = [NSDate dateWithISO8601String:@\"2016-01-23T10:00:00+00:00\"];","path":"APCAppCore/APCAppCoreTests/Reminder Tests/APCTasksReminderManagerTests.m","position":79,"original_position":79,"commit_id":"4a16a71e6b1f937873f69a92300f170217240785","original_commit_id":"4a16a71e6b1f937873f69a92300f170217240785","user":{"login":"syoung-smallwisdom","id":5649217,"avatar_url":"https://avatars.githubusercontent.com/u/5649217?v=3","gravatar_id":"","url":"https://api.github.com/users/syoung-smallwisdom","html_url":"https://github.com/syoung-smallwisdom","followers_url":"https://api.github.com/users/syoung-smallwisdom/followers","following_url":"https://api.github.com/users/syoung-smallwisdom/following{/other_user}","gists_url":"https://api.github.com/users/syoung-smallwisdom/gists{/gist_id}","starred_url":"https://api.github.com/users/syoung-smallwisdom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syoung-smallwisdom/subscriptions","organizations_url":"https://api.github.com/users/syoung-smallwisdom/orgs","repos_url":"https://api.github.com/users/syoung-smallwisdom/repos","events_url":"https://api.github.com/users/syoung-smallwisdom/events{/privacy}","received_events_url":"https://api.github.com/users/syoung-smallwisdom/received_events","type":"User","site_admin":false},"body":"Nice use of GMT","created_at":"2016-01-27T19:51:09Z","updated_at":"2016-01-27T19:51:09Z","html_url":"https://github.com/Sage-Bionetworks/AppCore/pull/67#discussion_r51039851","pull_request_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/comments/51039851"},"html":{"href":"https://github.com/Sage-Bionetworks/AppCore/pull/67#discussion_r51039851"},"pull_request":{"href":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/67","id":57104752,"html_url":"https://github.com/Sage-Bionetworks/AppCore/pull/67","diff_url":"https://github.com/Sage-Bionetworks/AppCore/pull/67.diff","patch_url":"https://github.com/Sage-Bionetworks/AppCore/pull/67.patch","issue_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/issues/67","number":67,"state":"open","locked":false,"title":"Feature/fphs 118","user":{"login":"dephillipsmichael","id":5590748,"avatar_url":"https://avatars.githubusercontent.com/u/5590748?v=3","gravatar_id":"","url":"https://api.github.com/users/dephillipsmichael","html_url":"https://github.com/dephillipsmichael","followers_url":"https://api.github.com/users/dephillipsmichael/followers","following_url":"https://api.github.com/users/dephillipsmichael/following{/other_user}","gists_url":"https://api.github.com/users/dephillipsmichael/gists{/gist_id}","starred_url":"https://api.github.com/users/dephillipsmichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dephillipsmichael/subscriptions","organizations_url":"https://api.github.com/users/dephillipsmichael/orgs","repos_url":"https://api.github.com/users/dephillipsmichael/repos","events_url":"https://api.github.com/users/dephillipsmichael/events{/privacy}","received_events_url":"https://api.github.com/users/dephillipsmichael/received_events","type":"User","site_admin":false},"body":"Changes in AppCore to support weekday frequency reminders and also keep old reminder system working by default\r\n\r\nFor testing purposes, I preformed these 3 tests of satisfaction\r\n\r\nTests can be achieved by setting the date & time in iOS general settings to one minute before the expected time, and watching notification fire after time turns to 5:00 PM in any timezone.\r\n\r\nTest Case 1:\r\nNew activities received on Sunday.\r\nNotification appears on Sunday at 5PM\r\nNotification appears on Tuesday at 5PM\r\nNotifications appear next Sunday and Tuesday without opening the app\r\n\r\nTest Case 2:\r\nNew activities received on Sunday.\r\nNotification appears on Sunday at 5PM\r\nDo all activities\r\nNo Notification appears on Tuesday at 5PM\r\nNotifications appear next Sunday and Tuesday without opening the app\r\n\r\nTest Case 3:\r\nNew activities received on Sunday.\r\nDo all activities\r\nNo Notification appears on Sunday at 5PM\r\nNo Notification appears on Tuesday at 5PM\r\nNotifications appear next Sunday and Tuesday without opening the app","created_at":"2016-01-25T17:43:59Z","updated_at":"2016-01-27T19:51:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"900daa8645655374e6acbdc27204cb79a4bc46e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/67/commits","review_comments_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/67/comments","review_comment_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/issues/67/comments","statuses_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/statuses/4a16a71e6b1f937873f69a92300f170217240785","head":{"label":"dephillipsmichael:feature/FPHS-118","ref":"feature/FPHS-118","sha":"4a16a71e6b1f937873f69a92300f170217240785","user":{"login":"dephillipsmichael","id":5590748,"avatar_url":"https://avatars.githubusercontent.com/u/5590748?v=3","gravatar_id":"","url":"https://api.github.com/users/dephillipsmichael","html_url":"https://github.com/dephillipsmichael","followers_url":"https://api.github.com/users/dephillipsmichael/followers","following_url":"https://api.github.com/users/dephillipsmichael/following{/other_user}","gists_url":"https://api.github.com/users/dephillipsmichael/gists{/gist_id}","starred_url":"https://api.github.com/users/dephillipsmichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dephillipsmichael/subscriptions","organizations_url":"https://api.github.com/users/dephillipsmichael/orgs","repos_url":"https://api.github.com/users/dephillipsmichael/repos","events_url":"https://api.github.com/users/dephillipsmichael/events{/privacy}","received_events_url":"https://api.github.com/users/dephillipsmichael/received_events","type":"User","site_admin":false},"repo":{"id":45642648,"name":"AppCore","full_name":"dephillipsmichael/AppCore","owner":{"login":"dephillipsmichael","id":5590748,"avatar_url":"https://avatars.githubusercontent.com/u/5590748?v=3","gravatar_id":"","url":"https://api.github.com/users/dephillipsmichael","html_url":"https://github.com/dephillipsmichael","followers_url":"https://api.github.com/users/dephillipsmichael/followers","following_url":"https://api.github.com/users/dephillipsmichael/following{/other_user}","gists_url":"https://api.github.com/users/dephillipsmichael/gists{/gist_id}","starred_url":"https://api.github.com/users/dephillipsmichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dephillipsmichael/subscriptions","organizations_url":"https://api.github.com/users/dephillipsmichael/orgs","repos_url":"https://api.github.com/users/dephillipsmichael/repos","events_url":"https://api.github.com/users/dephillipsmichael/events{/privacy}","received_events_url":"https://api.github.com/users/dephillipsmichael/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dephillipsmichael/AppCore","description":"Core code shared by the initial ResearchKit apps.","fork":true,"url":"https://api.github.com/repos/dephillipsmichael/AppCore","forks_url":"https://api.github.com/repos/dephillipsmichael/AppCore/forks","keys_url":"https://api.github.com/repos/dephillipsmichael/AppCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dephillipsmichael/AppCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dephillipsmichael/AppCore/teams","hooks_url":"https://api.github.com/repos/dephillipsmichael/AppCore/hooks","issue_events_url":"https://api.github.com/repos/dephillipsmichael/AppCore/issues/events{/number}","events_url":"https://api.github.com/repos/dephillipsmichael/AppCore/events","assignees_url":"https://api.github.com/repos/dephillipsmichael/AppCore/assignees{/user}","branches_url":"https://api.github.com/repos/dephillipsmichael/AppCore/branches{/branch}","tags_url":"https://api.github.com/repos/dephillipsmichael/AppCore/tags","blobs_url":"https://api.github.com/repos/dephillipsmichael/AppCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dephillipsmichael/AppCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dephillipsmichael/AppCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/dephillipsmichael/AppCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dephillipsmichael/AppCore/statuses/{sha}","languages_url":"https://api.github.com/repos/dephillipsmichael/AppCore/languages","stargazers_url":"https://api.github.com/repos/dephillipsmichael/AppCore/stargazers","contributors_url":"https://api.github.com/repos/dephillipsmichael/AppCore/contributors","subscribers_url":"https://api.github.com/repos/dephillipsmichael/AppCore/subscribers","subscription_url":"https://api.github.com/repos/dephillipsmichael/AppCore/subscription","commits_url":"https://api.github.com/repos/dephillipsmichael/AppCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/dephillipsmichael/AppCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/dephillipsmichael/AppCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/dephillipsmichael/AppCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/dephillipsmichael/AppCore/contents/{+path}","compare_url":"https://api.github.com/repos/dephillipsmichael/AppCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dephillipsmichael/AppCore/merges","archive_url":"https://api.github.com/repos/dephillipsmichael/AppCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dephillipsmichael/AppCore/downloads","issues_url":"https://api.github.com/repos/dephillipsmichael/AppCore/issues{/number}","pulls_url":"https://api.github.com/repos/dephillipsmichael/AppCore/pulls{/number}","milestones_url":"https://api.github.com/repos/dephillipsmichael/AppCore/milestones{/number}","notifications_url":"https://api.github.com/repos/dephillipsmichael/AppCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dephillipsmichael/AppCore/labels{/name}","releases_url":"https://api.github.com/repos/dephillipsmichael/AppCore/releases{/id}","deployments_url":"https://api.github.com/repos/dephillipsmichael/AppCore/deployments","created_at":"2015-11-05T22:09:30Z","updated_at":"2015-11-05T22:09:33Z","pushed_at":"2016-01-26T23:28:41Z","git_url":"git://github.com/dephillipsmichael/AppCore.git","ssh_url":"git@github.com:dephillipsmichael/AppCore.git","clone_url":"https://github.com/dephillipsmichael/AppCore.git","svn_url":"https://github.com/dephillipsmichael/AppCore","homepage":"","size":10822,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Sage-Bionetworks:master","ref":"master","sha":"b0ae4dd75db00839e2d3502248837ffeb7b4f6bd","user":{"login":"Sage-Bionetworks","id":1250897,"avatar_url":"https://avatars.githubusercontent.com/u/1250897?v=3","gravatar_id":"","url":"https://api.github.com/users/Sage-Bionetworks","html_url":"https://github.com/Sage-Bionetworks","followers_url":"https://api.github.com/users/Sage-Bionetworks/followers","following_url":"https://api.github.com/users/Sage-Bionetworks/following{/other_user}","gists_url":"https://api.github.com/users/Sage-Bionetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/Sage-Bionetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sage-Bionetworks/subscriptions","organizations_url":"https://api.github.com/users/Sage-Bionetworks/orgs","repos_url":"https://api.github.com/users/Sage-Bionetworks/repos","events_url":"https://api.github.com/users/Sage-Bionetworks/events{/privacy}","received_events_url":"https://api.github.com/users/Sage-Bionetworks/received_events","type":"Organization","site_admin":false},"repo":{"id":39029064,"name":"AppCore","full_name":"Sage-Bionetworks/AppCore","owner":{"login":"Sage-Bionetworks","id":1250897,"avatar_url":"https://avatars.githubusercontent.com/u/1250897?v=3","gravatar_id":"","url":"https://api.github.com/users/Sage-Bionetworks","html_url":"https://github.com/Sage-Bionetworks","followers_url":"https://api.github.com/users/Sage-Bionetworks/followers","following_url":"https://api.github.com/users/Sage-Bionetworks/following{/other_user}","gists_url":"https://api.github.com/users/Sage-Bionetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/Sage-Bionetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sage-Bionetworks/subscriptions","organizations_url":"https://api.github.com/users/Sage-Bionetworks/orgs","repos_url":"https://api.github.com/users/Sage-Bionetworks/repos","events_url":"https://api.github.com/users/Sage-Bionetworks/events{/privacy}","received_events_url":"https://api.github.com/users/Sage-Bionetworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sage-Bionetworks/AppCore","description":"Core code shared by the initial ResearchKit apps.","fork":true,"url":"https://api.github.com/repos/Sage-Bionetworks/AppCore","forks_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/forks","keys_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/teams","hooks_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/hooks","issue_events_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/issues/events{/number}","events_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/events","assignees_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/assignees{/user}","branches_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/branches{/branch}","tags_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/tags","blobs_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/statuses/{sha}","languages_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/languages","stargazers_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/stargazers","contributors_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/contributors","subscribers_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/subscribers","subscription_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/subscription","commits_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/contents/{+path}","compare_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/merges","archive_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/downloads","issues_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/issues{/number}","pulls_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls{/number}","milestones_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/milestones{/number}","notifications_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/labels{/name}","releases_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/releases{/id}","deployments_url":"https://api.github.com/repos/Sage-Bionetworks/AppCore/deployments","created_at":"2015-07-13T18:12:51Z","updated_at":"2016-01-12T23:03:29Z","pushed_at":"2016-01-26T23:28:41Z","git_url":"git://github.com/Sage-Bionetworks/AppCore.git","ssh_url":"git@github.com:Sage-Bionetworks/AppCore.git","clone_url":"https://github.com/Sage-Bionetworks/AppCore.git","svn_url":"https://github.com/Sage-Bionetworks/AppCore","homepage":"","size":10844,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/67"},"html":{"href":"https://github.com/Sage-Bionetworks/AppCore/pull/67"},"issue":{"href":"https://api.github.com/repos/Sage-Bionetworks/AppCore/issues/67"},"comments":{"href":"https://api.github.com/repos/Sage-Bionetworks/AppCore/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sage-Bionetworks/AppCore/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/Sage-Bionetworks/AppCore/statuses/4a16a71e6b1f937873f69a92300f170217240785"}}}}