{"action":"created","comment":{"url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments/47365695","id":47365695,"diff_hunk":"@@ -0,0 +1,88 @@\n+package ru.unn.agile.MergeSort.Infrastructure;\n+\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+import java.io.BufferedReader;\n+import java.io.FileNotFoundException;\n+import java.io.FileReader;\n+\n+import static junit.framework.TestCase.assertEquals;\n+import static junit.framework.TestCase.assertNotNull;\n+import static org.junit.Assert.assertThat;\n+import static org.junit.Assert.fail;\n+import static ru.unn.agile.MergeSort.ViewModel.MergeSortRegexMatcher.matches;\n+\n+public class MergeSortFileLoggerTests {\n+    @Before\n+    public void setUp() {\n+        fileLogger = new MergeSortFileLogger(OUTPUT_FILE_NAME);\n+    }\n+\n+    @Test\n+    public void canCreateFileWithOutputFileName() {\n+        try {\n+            new BufferedReader(new FileReader(OUTPUT_FILE_NAME));\n+        } catch (FileNotFoundException exception) {\n+            fail(\"Output file \" + OUTPUT_FILE_NAME + \" wasn't created.\");\n+        }\n+    }\n+\n+    @Test\n+    public void canCreateFileLoggerWithOutputFileName() {\n+        assertNotNull(fileLogger);\n+    }\n+\n+    @Test\n+    public void canWriteRecordWithFileLogger() {\n+        fileLogger.writeRecord(\"Sample\");\n+\n+        assertEquals(1, fileLogger.getRecordsCount());\n+    }\n+\n+    @Test\n+    public void canReadRecordWithFileLogger() {\n+        fileLogger.writeRecord(\"Sample\");\n+\n+        assertThat(fileLogger.readRecord(0), matches(\".*\" + \"Sample\" + \".*\"));\n+    }\n+\n+    @Test\n+    public void canWriteSeveralRecordsWithFileLogger() {\n+        fileLogger.writeRecord(\"Sample1\");\n+        fileLogger.writeRecord(\"Sample2\");\n+        fileLogger.writeRecord(\"Sample3\");\n+\n+        assertEquals(3, fileLogger.getRecordsCount());\n+    }\n+\n+    @Test\n+    public void canReadRecordsListFromFileLogger() {\n+        fileLogger.writeRecord(\"Sample1\");\n+        fileLogger.writeRecord(\"Sample2\");\n+\n+        assertEquals(2, fileLogger.getRecordsList().size());\n+    }\n+\n+    @Test\n+    public void isReadRecordReturnNullWhenRecordNumberIsOutOfBounds() {\n+        fileLogger.writeRecord(\"Sample1\");\n+        fileLogger.writeRecord(\"Sample2\");\n+\n+        assertEquals(null, fileLogger.readRecord(2));","path":"code/gorokhov-dmitriy/Infrastructure/src/test/java/ru/unn/agile/MergeSort/Infrastructure/MergeSortFileLoggerTests.java","position":72,"original_position":72,"commit_id":"0d340071f798885964e0cf4fac4644d97a4e0a28","original_commit_id":"0d340071f798885964e0cf4fac4644d97a4e0a28","user":{"login":"vladimir-paramuzov","id":15000976,"avatar_url":"https://avatars.githubusercontent.com/u/15000976?v=3","gravatar_id":"","url":"https://api.github.com/users/vladimir-paramuzov","html_url":"https://github.com/vladimir-paramuzov","followers_url":"https://api.github.com/users/vladimir-paramuzov/followers","following_url":"https://api.github.com/users/vladimir-paramuzov/following{/other_user}","gists_url":"https://api.github.com/users/vladimir-paramuzov/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimir-paramuzov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimir-paramuzov/subscriptions","organizations_url":"https://api.github.com/users/vladimir-paramuzov/orgs","repos_url":"https://api.github.com/users/vladimir-paramuzov/repos","events_url":"https://api.github.com/users/vladimir-paramuzov/events{/privacy}","received_events_url":"https://api.github.com/users/vladimir-paramuzov/received_events","type":"User","site_admin":false},"body":"assertNull?","created_at":"2015-12-11T15:22:22Z","updated_at":"2015-12-11T15:22:22Z","html_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/154#discussion_r47365695","pull_request_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/154","_links":{"self":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments/47365695"},"html":{"href":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/154#discussion_r47365695"},"pull_request":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/154"}}},"pull_request":{"url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/154","id":53402354,"html_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/154","diff_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/154.diff","patch_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/154.patch","issue_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/154","number":154,"state":"open","locked":false,"title":"Горохов - Лабораторная работа #3","user":{"login":"gdmit","id":4019831,"avatar_url":"https://avatars.githubusercontent.com/u/4019831?v=3","gravatar_id":"","url":"https://api.github.com/users/gdmit","html_url":"https://github.com/gdmit","followers_url":"https://api.github.com/users/gdmit/followers","following_url":"https://api.github.com/users/gdmit/following{/other_user}","gists_url":"https://api.github.com/users/gdmit/gists{/gist_id}","starred_url":"https://api.github.com/users/gdmit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdmit/subscriptions","organizations_url":"https://api.github.com/users/gdmit/orgs","repos_url":"https://api.github.com/users/gdmit/repos","events_url":"https://api.github.com/users/gdmit/events{/privacy}","received_events_url":"https://api.github.com/users/gdmit/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-11T15:01:38Z","updated_at":"2015-12-11T15:22:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0bd6cce2b03d8c615835a82015163a7ba19d34c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/154/commits","review_comments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/154/comments","review_comment_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/154/comments","statuses_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/statuses/0d340071f798885964e0cf4fac4644d97a4e0a28","head":{"label":"gdmit:lab3-logger-mergesort","ref":"lab3-logger-mergesort","sha":"0d340071f798885964e0cf4fac4644d97a4e0a28","user":{"login":"gdmit","id":4019831,"avatar_url":"https://avatars.githubusercontent.com/u/4019831?v=3","gravatar_id":"","url":"https://api.github.com/users/gdmit","html_url":"https://github.com/gdmit","followers_url":"https://api.github.com/users/gdmit/followers","following_url":"https://api.github.com/users/gdmit/following{/other_user}","gists_url":"https://api.github.com/users/gdmit/gists{/gist_id}","starred_url":"https://api.github.com/users/gdmit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdmit/subscriptions","organizations_url":"https://api.github.com/users/gdmit/orgs","repos_url":"https://api.github.com/users/gdmit/repos","events_url":"https://api.github.com/users/gdmit/events{/privacy}","received_events_url":"https://api.github.com/users/gdmit/received_events","type":"User","site_admin":false},"repo":{"id":44682962,"name":"agile-course-practice","full_name":"gdmit/agile-course-practice","owner":{"login":"gdmit","id":4019831,"avatar_url":"https://avatars.githubusercontent.com/u/4019831?v=3","gravatar_id":"","url":"https://api.github.com/users/gdmit","html_url":"https://github.com/gdmit","followers_url":"https://api.github.com/users/gdmit/followers","following_url":"https://api.github.com/users/gdmit/following{/other_user}","gists_url":"https://api.github.com/users/gdmit/gists{/gist_id}","starred_url":"https://api.github.com/users/gdmit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdmit/subscriptions","organizations_url":"https://api.github.com/users/gdmit/orgs","repos_url":"https://api.github.com/users/gdmit/repos","events_url":"https://api.github.com/users/gdmit/events{/privacy}","received_events_url":"https://api.github.com/users/gdmit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gdmit/agile-course-practice","description":"Проект-шаблон для выполнения лабораторных работ по курсу Agile Development","fork":true,"url":"https://api.github.com/repos/gdmit/agile-course-practice","forks_url":"https://api.github.com/repos/gdmit/agile-course-practice/forks","keys_url":"https://api.github.com/repos/gdmit/agile-course-practice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gdmit/agile-course-practice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gdmit/agile-course-practice/teams","hooks_url":"https://api.github.com/repos/gdmit/agile-course-practice/hooks","issue_events_url":"https://api.github.com/repos/gdmit/agile-course-practice/issues/events{/number}","events_url":"https://api.github.com/repos/gdmit/agile-course-practice/events","assignees_url":"https://api.github.com/repos/gdmit/agile-course-practice/assignees{/user}","branches_url":"https://api.github.com/repos/gdmit/agile-course-practice/branches{/branch}","tags_url":"https://api.github.com/repos/gdmit/agile-course-practice/tags","blobs_url":"https://api.github.com/repos/gdmit/agile-course-practice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gdmit/agile-course-practice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gdmit/agile-course-practice/git/refs{/sha}","trees_url":"https://api.github.com/repos/gdmit/agile-course-practice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gdmit/agile-course-practice/statuses/{sha}","languages_url":"https://api.github.com/repos/gdmit/agile-course-practice/languages","stargazers_url":"https://api.github.com/repos/gdmit/agile-course-practice/stargazers","contributors_url":"https://api.github.com/repos/gdmit/agile-course-practice/contributors","subscribers_url":"https://api.github.com/repos/gdmit/agile-course-practice/subscribers","subscription_url":"https://api.github.com/repos/gdmit/agile-course-practice/subscription","commits_url":"https://api.github.com/repos/gdmit/agile-course-practice/commits{/sha}","git_commits_url":"https://api.github.com/repos/gdmit/agile-course-practice/git/commits{/sha}","comments_url":"https://api.github.com/repos/gdmit/agile-course-practice/comments{/number}","issue_comment_url":"https://api.github.com/repos/gdmit/agile-course-practice/issues/comments{/number}","contents_url":"https://api.github.com/repos/gdmit/agile-course-practice/contents/{+path}","compare_url":"https://api.github.com/repos/gdmit/agile-course-practice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gdmit/agile-course-practice/merges","archive_url":"https://api.github.com/repos/gdmit/agile-course-practice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gdmit/agile-course-practice/downloads","issues_url":"https://api.github.com/repos/gdmit/agile-course-practice/issues{/number}","pulls_url":"https://api.github.com/repos/gdmit/agile-course-practice/pulls{/number}","milestones_url":"https://api.github.com/repos/gdmit/agile-course-practice/milestones{/number}","notifications_url":"https://api.github.com/repos/gdmit/agile-course-practice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gdmit/agile-course-practice/labels{/name}","releases_url":"https://api.github.com/repos/gdmit/agile-course-practice/releases{/id}","created_at":"2015-10-21T14:44:03Z","updated_at":"2015-10-21T14:44:03Z","pushed_at":"2015-12-11T14:59:09Z","git_url":"git://github.com/gdmit/agile-course-practice.git","ssh_url":"git@github.com:gdmit/agile-course-practice.git","clone_url":"https://github.com/gdmit/agile-course-practice.git","svn_url":"https://github.com/gdmit/agile-course-practice","homepage":"","size":5219,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"UNN-VMK-Software:master","ref":"master","sha":"f9b64208c1f322f10f73b82adb533533a5c0b2b1","user":{"login":"UNN-VMK-Software","id":5463209,"avatar_url":"https://avatars.githubusercontent.com/u/5463209?v=3","gravatar_id":"","url":"https://api.github.com/users/UNN-VMK-Software","html_url":"https://github.com/UNN-VMK-Software","followers_url":"https://api.github.com/users/UNN-VMK-Software/followers","following_url":"https://api.github.com/users/UNN-VMK-Software/following{/other_user}","gists_url":"https://api.github.com/users/UNN-VMK-Software/gists{/gist_id}","starred_url":"https://api.github.com/users/UNN-VMK-Software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNN-VMK-Software/subscriptions","organizations_url":"https://api.github.com/users/UNN-VMK-Software/orgs","repos_url":"https://api.github.com/users/UNN-VMK-Software/repos","events_url":"https://api.github.com/users/UNN-VMK-Software/events{/privacy}","received_events_url":"https://api.github.com/users/UNN-VMK-Software/received_events","type":"Organization","site_admin":false},"repo":{"id":44518750,"name":"agile-course-practice","full_name":"UNN-VMK-Software/agile-course-practice","owner":{"login":"UNN-VMK-Software","id":5463209,"avatar_url":"https://avatars.githubusercontent.com/u/5463209?v=3","gravatar_id":"","url":"https://api.github.com/users/UNN-VMK-Software","html_url":"https://github.com/UNN-VMK-Software","followers_url":"https://api.github.com/users/UNN-VMK-Software/followers","following_url":"https://api.github.com/users/UNN-VMK-Software/following{/other_user}","gists_url":"https://api.github.com/users/UNN-VMK-Software/gists{/gist_id}","starred_url":"https://api.github.com/users/UNN-VMK-Software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNN-VMK-Software/subscriptions","organizations_url":"https://api.github.com/users/UNN-VMK-Software/orgs","repos_url":"https://api.github.com/users/UNN-VMK-Software/repos","events_url":"https://api.github.com/users/UNN-VMK-Software/events{/privacy}","received_events_url":"https://api.github.com/users/UNN-VMK-Software/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UNN-VMK-Software/agile-course-practice","description":"Проект-шаблон для выполнения лабораторных работ по курсу Agile Development","fork":false,"url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice","forks_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/forks","keys_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/teams","hooks_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/hooks","issue_events_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/events{/number}","events_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/events","assignees_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/assignees{/user}","branches_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/branches{/branch}","tags_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/tags","blobs_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/refs{/sha}","trees_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/statuses/{sha}","languages_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/languages","stargazers_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/stargazers","contributors_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/contributors","subscribers_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/subscribers","subscription_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/subscription","commits_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/commits{/sha}","git_commits_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/commits{/sha}","comments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/comments{/number}","issue_comment_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/comments{/number}","contents_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/contents/{+path}","compare_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/merges","archive_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/downloads","issues_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues{/number}","pulls_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls{/number}","milestones_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/milestones{/number}","notifications_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/labels{/name}","releases_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/releases{/id}","created_at":"2015-10-19T07:42:22Z","updated_at":"2015-10-29T19:46:12Z","pushed_at":"2015-12-11T15:03:11Z","git_url":"git://github.com/UNN-VMK-Software/agile-course-practice.git","ssh_url":"git@github.com:UNN-VMK-Software/agile-course-practice.git","clone_url":"https://github.com/UNN-VMK-Software/agile-course-practice.git","svn_url":"https://github.com/UNN-VMK-Software/agile-course-practice","homepage":"","size":5525,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":13,"forks":46,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/154"},"html":{"href":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/154"},"issue":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/154"},"comments":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/statuses/0d340071f798885964e0cf4fac4644d97a4e0a28"}}}}