{"action":"created","comment":{"url":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/comments/53194336","id":53194336,"diff_hunk":"@@ -0,0 +1,152 @@\n+import org.mockito.Mockito;\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+import static junit.framework.TestCase.assertEquals;\n+import static org.mockito.Mockito.when;\n+\n+public class PlayerTest {\n+    Player player;\n+    Userable user;\n+\n+\n+    @Before\n+    public void playerCreate() {\n+        user = Mockito.mock(Userable.class);\n+        player = Player.build(user);\n+    }\n+\n+\n+\n+    private void testGetScoreInMoment(FrameValuesForTest[] testSet) {\n+        for (FrameValuesForTest aTestSet : testSet) {\n+            for (int j = 0; j < aTestSet.keggleCount.length; j++) {\n+                player.throwBall(aTestSet.keggleCount[j]);\n+                assertEquals(aTestSet.scoreInMoment[j], player.getScore());\n+            }\n+        }\n+    }\n+\n+    private void testGetScoreInThrows(FrameValuesForTest[] testSet) {\n+        int throwCount = 0;\n+        assertEqualsScoreInNThrows(testSet, throwCount);\n+        for (FrameValuesForTest aTestSet : testSet) {\n+            for (int throwIndex = 0; throwIndex < aTestSet.keggleCount.length; throwIndex++) {\n+                player.throwBall(aTestSet.keggleCount[throwIndex]);\n+                throwCount++;\n+                assertEqualsScoreInNThrows(testSet, throwCount);\n+            }\n+        }\n+    }\n+\n+    private void assertEqualsScoreInNThrows(FrameValuesForTest[] testSet, int throwCount) {\n+        for (int i = 0; i < testSet.length; i++) {\n+            if (throwCount < testSet[i].scoreInNThrows.length) {\n+                assertEquals(testSet[i].scoreInNThrows[throwCount], player.getScore(i));\n+            }\n+        }\n+    }\n+\n+\n+    private void testGetFrameNumber(FrameValuesForTest[] testSet) {\n+        for (int i = 0; i < testSet.length; i++) {\n+            for (int j = 0; j < testSet[i].keggleCount.length; j++) {\n+                assertEquals(i, player.getFrameNumber());\n+                player.throwBall(testSet[i].keggleCount[j]);\n+            }\n+        }\n+    }\n+\n+    private void testGameFinish(FrameValuesForTest[] testSet) {\n+        for (FrameValuesForTest aTestSet : testSet) {\n+            for (int j = 0; j < aTestSet.keggleCount.length; j++) {\n+                assertEquals(false, player.gameFinished());\n+                player.throwBall(aTestSet.keggleCount[j]);\n+            }\n+        }\n+        assertEquals(true, player.gameFinished());\n+    }\n+\n+    @Test\n+    public void testGetName() {\n+        when(user.getName()).thenReturn(\"User 314\");\n+        assertEquals(\"User 314\", player.getName());\n+\n+        when(user.getName()).thenReturn(\"Dima\");\n+        assertEquals(\"Dima\", player.getName());\n+    }\n+\n+    @Test\n+    public void testGetScoreInMoment1() throws Exception {","path":"src/PlayerTest.java","position":80,"original_position":80,"commit_id":"389ff1824cf138f340984ccf5f4f948321c3f318","original_commit_id":"389ff1824cf138f340984ccf5f4f948321c3f318","user":{"login":"mhty","id":8664606,"avatar_url":"https://avatars.githubusercontent.com/u/8664606?v=3","gravatar_id":"","url":"https://api.github.com/users/mhty","html_url":"https://github.com/mhty","followers_url":"https://api.github.com/users/mhty/followers","following_url":"https://api.github.com/users/mhty/following{/other_user}","gists_url":"https://api.github.com/users/mhty/gists{/gist_id}","starred_url":"https://api.github.com/users/mhty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhty/subscriptions","organizations_url":"https://api.github.com/users/mhty/orgs","repos_url":"https://api.github.com/users/mhty/repos","events_url":"https://api.github.com/users/mhty/events{/privacy}","received_events_url":"https://api.github.com/users/mhty/received_events","type":"User","site_admin":false},"body":"1 - нет страйков, нет spare\r\n2 - нет страйков, есть spare\r\n3 - есть всё","created_at":"2016-02-17T16:53:46Z","updated_at":"2016-02-17T16:53:46Z","html_url":"https://github.com/dosy4ev/BowlingHH/pull/1#discussion_r53194336","pull_request_url":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/comments/53194336"},"html":{"href":"https://github.com/dosy4ev/BowlingHH/pull/1#discussion_r53194336"},"pull_request":{"href":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/1","id":59637852,"html_url":"https://github.com/dosy4ev/BowlingHH/pull/1","diff_url":"https://github.com/dosy4ev/BowlingHH/pull/1.diff","patch_url":"https://github.com/dosy4ev/BowlingHH/pull/1.patch","issue_url":"https://api.github.com/repos/dosy4ev/BowlingHH/issues/1","number":1,"state":"open","locked":false,"title":"Full code review","user":{"login":"dosy4ev","id":651125,"avatar_url":"https://avatars.githubusercontent.com/u/651125?v=3","gravatar_id":"","url":"https://api.github.com/users/dosy4ev","html_url":"https://github.com/dosy4ev","followers_url":"https://api.github.com/users/dosy4ev/followers","following_url":"https://api.github.com/users/dosy4ev/following{/other_user}","gists_url":"https://api.github.com/users/dosy4ev/gists{/gist_id}","starred_url":"https://api.github.com/users/dosy4ev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dosy4ev/subscriptions","organizations_url":"https://api.github.com/users/dosy4ev/orgs","repos_url":"https://api.github.com/users/dosy4ev/repos","events_url":"https://api.github.com/users/dosy4ev/events{/privacy}","received_events_url":"https://api.github.com/users/dosy4ev/received_events","type":"User","site_admin":false},"body":"Пришлось форкнуть и поизвращаться с ветками, чтоб в пул реквест попал весь код.","created_at":"2016-02-17T12:37:53Z","updated_at":"2016-02-17T16:53:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64f841cf1d9547147b4900bae9ae1dc24893f6e5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/1/commits","review_comments_url":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/1/comments","review_comment_url":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dosy4ev/BowlingHH/issues/1/comments","statuses_url":"https://api.github.com/repos/dosy4ev/BowlingHH/statuses/389ff1824cf138f340984ccf5f4f948321c3f318","head":{"label":"dosy4ev:review","ref":"review","sha":"389ff1824cf138f340984ccf5f4f948321c3f318","user":{"login":"dosy4ev","id":651125,"avatar_url":"https://avatars.githubusercontent.com/u/651125?v=3","gravatar_id":"","url":"https://api.github.com/users/dosy4ev","html_url":"https://github.com/dosy4ev","followers_url":"https://api.github.com/users/dosy4ev/followers","following_url":"https://api.github.com/users/dosy4ev/following{/other_user}","gists_url":"https://api.github.com/users/dosy4ev/gists{/gist_id}","starred_url":"https://api.github.com/users/dosy4ev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dosy4ev/subscriptions","organizations_url":"https://api.github.com/users/dosy4ev/orgs","repos_url":"https://api.github.com/users/dosy4ev/repos","events_url":"https://api.github.com/users/dosy4ev/events{/privacy}","received_events_url":"https://api.github.com/users/dosy4ev/received_events","type":"User","site_admin":false},"repo":{"id":51920800,"name":"BowlingHH","full_name":"dosy4ev/BowlingHH","owner":{"login":"dosy4ev","id":651125,"avatar_url":"https://avatars.githubusercontent.com/u/651125?v=3","gravatar_id":"","url":"https://api.github.com/users/dosy4ev","html_url":"https://github.com/dosy4ev","followers_url":"https://api.github.com/users/dosy4ev/followers","following_url":"https://api.github.com/users/dosy4ev/following{/other_user}","gists_url":"https://api.github.com/users/dosy4ev/gists{/gist_id}","starred_url":"https://api.github.com/users/dosy4ev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dosy4ev/subscriptions","organizations_url":"https://api.github.com/users/dosy4ev/orgs","repos_url":"https://api.github.com/users/dosy4ev/repos","events_url":"https://api.github.com/users/dosy4ev/events{/privacy}","received_events_url":"https://api.github.com/users/dosy4ev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dosy4ev/BowlingHH","description":"","fork":true,"url":"https://api.github.com/repos/dosy4ev/BowlingHH","forks_url":"https://api.github.com/repos/dosy4ev/BowlingHH/forks","keys_url":"https://api.github.com/repos/dosy4ev/BowlingHH/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dosy4ev/BowlingHH/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dosy4ev/BowlingHH/teams","hooks_url":"https://api.github.com/repos/dosy4ev/BowlingHH/hooks","issue_events_url":"https://api.github.com/repos/dosy4ev/BowlingHH/issues/events{/number}","events_url":"https://api.github.com/repos/dosy4ev/BowlingHH/events","assignees_url":"https://api.github.com/repos/dosy4ev/BowlingHH/assignees{/user}","branches_url":"https://api.github.com/repos/dosy4ev/BowlingHH/branches{/branch}","tags_url":"https://api.github.com/repos/dosy4ev/BowlingHH/tags","blobs_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/refs{/sha}","trees_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dosy4ev/BowlingHH/statuses/{sha}","languages_url":"https://api.github.com/repos/dosy4ev/BowlingHH/languages","stargazers_url":"https://api.github.com/repos/dosy4ev/BowlingHH/stargazers","contributors_url":"https://api.github.com/repos/dosy4ev/BowlingHH/contributors","subscribers_url":"https://api.github.com/repos/dosy4ev/BowlingHH/subscribers","subscription_url":"https://api.github.com/repos/dosy4ev/BowlingHH/subscription","commits_url":"https://api.github.com/repos/dosy4ev/BowlingHH/commits{/sha}","git_commits_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/commits{/sha}","comments_url":"https://api.github.com/repos/dosy4ev/BowlingHH/comments{/number}","issue_comment_url":"https://api.github.com/repos/dosy4ev/BowlingHH/issues/comments{/number}","contents_url":"https://api.github.com/repos/dosy4ev/BowlingHH/contents/{+path}","compare_url":"https://api.github.com/repos/dosy4ev/BowlingHH/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dosy4ev/BowlingHH/merges","archive_url":"https://api.github.com/repos/dosy4ev/BowlingHH/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dosy4ev/BowlingHH/downloads","issues_url":"https://api.github.com/repos/dosy4ev/BowlingHH/issues{/number}","pulls_url":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls{/number}","milestones_url":"https://api.github.com/repos/dosy4ev/BowlingHH/milestones{/number}","notifications_url":"https://api.github.com/repos/dosy4ev/BowlingHH/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dosy4ev/BowlingHH/labels{/name}","releases_url":"https://api.github.com/repos/dosy4ev/BowlingHH/releases{/id}","deployments_url":"https://api.github.com/repos/dosy4ev/BowlingHH/deployments","created_at":"2016-02-17T12:25:15Z","updated_at":"2016-02-17T12:25:16Z","pushed_at":"2016-02-17T12:37:53Z","git_url":"git://github.com/dosy4ev/BowlingHH.git","ssh_url":"git@github.com:dosy4ev/BowlingHH.git","clone_url":"https://github.com/dosy4ev/BowlingHH.git","svn_url":"https://github.com/dosy4ev/BowlingHH","homepage":null,"size":99,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"dosy4ev:empty","ref":"empty","sha":"b044a8e23b8da2a2eadb98bbad10d54fbadfa4cd","user":{"login":"dosy4ev","id":651125,"avatar_url":"https://avatars.githubusercontent.com/u/651125?v=3","gravatar_id":"","url":"https://api.github.com/users/dosy4ev","html_url":"https://github.com/dosy4ev","followers_url":"https://api.github.com/users/dosy4ev/followers","following_url":"https://api.github.com/users/dosy4ev/following{/other_user}","gists_url":"https://api.github.com/users/dosy4ev/gists{/gist_id}","starred_url":"https://api.github.com/users/dosy4ev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dosy4ev/subscriptions","organizations_url":"https://api.github.com/users/dosy4ev/orgs","repos_url":"https://api.github.com/users/dosy4ev/repos","events_url":"https://api.github.com/users/dosy4ev/events{/privacy}","received_events_url":"https://api.github.com/users/dosy4ev/received_events","type":"User","site_admin":false},"repo":{"id":51920800,"name":"BowlingHH","full_name":"dosy4ev/BowlingHH","owner":{"login":"dosy4ev","id":651125,"avatar_url":"https://avatars.githubusercontent.com/u/651125?v=3","gravatar_id":"","url":"https://api.github.com/users/dosy4ev","html_url":"https://github.com/dosy4ev","followers_url":"https://api.github.com/users/dosy4ev/followers","following_url":"https://api.github.com/users/dosy4ev/following{/other_user}","gists_url":"https://api.github.com/users/dosy4ev/gists{/gist_id}","starred_url":"https://api.github.com/users/dosy4ev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dosy4ev/subscriptions","organizations_url":"https://api.github.com/users/dosy4ev/orgs","repos_url":"https://api.github.com/users/dosy4ev/repos","events_url":"https://api.github.com/users/dosy4ev/events{/privacy}","received_events_url":"https://api.github.com/users/dosy4ev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dosy4ev/BowlingHH","description":"","fork":true,"url":"https://api.github.com/repos/dosy4ev/BowlingHH","forks_url":"https://api.github.com/repos/dosy4ev/BowlingHH/forks","keys_url":"https://api.github.com/repos/dosy4ev/BowlingHH/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dosy4ev/BowlingHH/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dosy4ev/BowlingHH/teams","hooks_url":"https://api.github.com/repos/dosy4ev/BowlingHH/hooks","issue_events_url":"https://api.github.com/repos/dosy4ev/BowlingHH/issues/events{/number}","events_url":"https://api.github.com/repos/dosy4ev/BowlingHH/events","assignees_url":"https://api.github.com/repos/dosy4ev/BowlingHH/assignees{/user}","branches_url":"https://api.github.com/repos/dosy4ev/BowlingHH/branches{/branch}","tags_url":"https://api.github.com/repos/dosy4ev/BowlingHH/tags","blobs_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/refs{/sha}","trees_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dosy4ev/BowlingHH/statuses/{sha}","languages_url":"https://api.github.com/repos/dosy4ev/BowlingHH/languages","stargazers_url":"https://api.github.com/repos/dosy4ev/BowlingHH/stargazers","contributors_url":"https://api.github.com/repos/dosy4ev/BowlingHH/contributors","subscribers_url":"https://api.github.com/repos/dosy4ev/BowlingHH/subscribers","subscription_url":"https://api.github.com/repos/dosy4ev/BowlingHH/subscription","commits_url":"https://api.github.com/repos/dosy4ev/BowlingHH/commits{/sha}","git_commits_url":"https://api.github.com/repos/dosy4ev/BowlingHH/git/commits{/sha}","comments_url":"https://api.github.com/repos/dosy4ev/BowlingHH/comments{/number}","issue_comment_url":"https://api.github.com/repos/dosy4ev/BowlingHH/issues/comments{/number}","contents_url":"https://api.github.com/repos/dosy4ev/BowlingHH/contents/{+path}","compare_url":"https://api.github.com/repos/dosy4ev/BowlingHH/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dosy4ev/BowlingHH/merges","archive_url":"https://api.github.com/repos/dosy4ev/BowlingHH/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dosy4ev/BowlingHH/downloads","issues_url":"https://api.github.com/repos/dosy4ev/BowlingHH/issues{/number}","pulls_url":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls{/number}","milestones_url":"https://api.github.com/repos/dosy4ev/BowlingHH/milestones{/number}","notifications_url":"https://api.github.com/repos/dosy4ev/BowlingHH/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dosy4ev/BowlingHH/labels{/name}","releases_url":"https://api.github.com/repos/dosy4ev/BowlingHH/releases{/id}","deployments_url":"https://api.github.com/repos/dosy4ev/BowlingHH/deployments","created_at":"2016-02-17T12:25:15Z","updated_at":"2016-02-17T12:25:16Z","pushed_at":"2016-02-17T12:37:53Z","git_url":"git://github.com/dosy4ev/BowlingHH.git","ssh_url":"git@github.com:dosy4ev/BowlingHH.git","clone_url":"https://github.com/dosy4ev/BowlingHH.git","svn_url":"https://github.com/dosy4ev/BowlingHH","homepage":null,"size":99,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/1"},"html":{"href":"https://github.com/dosy4ev/BowlingHH/pull/1"},"issue":{"href":"https://api.github.com/repos/dosy4ev/BowlingHH/issues/1"},"comments":{"href":"https://api.github.com/repos/dosy4ev/BowlingHH/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dosy4ev/BowlingHH/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/dosy4ev/BowlingHH/statuses/389ff1824cf138f340984ccf5f4f948321c3f318"}}}}