{"action":"created","comment":{"url":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/comments/94223166","pull_request_review_id":14753112,"id":94223166,"diff_hunk":"@@ -0,0 +1,90 @@\n+package com.imbd.spbau;\n+\n+import com.googlecode.lanterna.screen.Screen;\n+import com.googlecode.lanterna.screen.TerminalScreen;\n+import com.googlecode.lanterna.terminal.DefaultTerminalFactory;\n+import com.googlecode.lanterna.terminal.Terminal;\n+import com.imbd.spbau.creature.Creature;\n+import com.imbd.spbau.strategy.DirectedStrategy;\n+import com.imbd.spbau.strategy.KeyboardStrategy;\n+import com.imbd.spbau.strategy.RandomStrategy;\n+import com.imbd.spbau.strategy.Strategy;\n+import org.junit.After;\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+import java.io.IOException;\n+\n+public class TestGame {\n+\n+    public Screen screen;\n+    GameController controller;\n+\n+    @Before\n+    public void initialize() throws IOException {\n+\n+        Terminal terminal = new DefaultTerminalFactory().createTerminal();\n+        screen = new TerminalScreen(terminal);\n+        controller = new GameController(screen, new KeyboardStrategy(screen));\n+    }\n+\n+    @Test\n+    public void testGame1() throws IOException {\n+\n+        controller.setPlayerStrategy(new RandomStrategy());\n+        int livesNumber = 10;\n+        while (livesNumber > 0) {\n+            if (!controller.run()) {\n+                return;\n+            } else {\n+                livesNumber--;\n+                controller.setOnStart();\n+            }\n+        }\n+    }\n+\n+    @Test\n+    public void testGame2() throws IOException {\n+\n+        controller.setPlayerStrategy(new DirectedStrategy('U'));\n+        int livesNumber = 20;\n+        while (livesNumber > 0) {\n+            if (!controller.run()) {\n+                return;\n+            } else {\n+                livesNumber--;\n+                controller.setOnStart();\n+            }\n+        }\n+    }\n+\n+    @Test\n+    public void testGame3() throws IOException {\n+\n+        controller.setPlayerStrategy(new Strategy() {\n+            @Override\n+            public Map.Position getMove(Creature creature, Map worldMap) {\n+                return creature.getPosition();\n+            }\n+\n+            @Override\n+            public int getInfo() {\n+                return -1;\n+            }\n+        });\n+        int livesNumber = 10;\n+        while (livesNumber > 0) {\n+            if (!controller.run()) {\n+                return;\n+            } else {\n+                livesNumber--;\n+                controller.setOnStart();\n+            }\n+        }\n+    }","path":"src/test/java/com/imbd/spbau/TestGame.java","position":44,"original_position":84,"commit_id":"3787f0566d61475df4fa2d8d1cdd06b483316696","original_commit_id":"3787f0566d61475df4fa2d8d1cdd06b483316696","user":{"login":"yurii-litvinov","id":706768,"avatar_url":"https://avatars.githubusercontent.com/u/706768?v=3","gravatar_id":"","url":"https://api.github.com/users/yurii-litvinov","html_url":"https://github.com/yurii-litvinov","followers_url":"https://api.github.com/users/yurii-litvinov/followers","following_url":"https://api.github.com/users/yurii-litvinov/following{/other_user}","gists_url":"https://api.github.com/users/yurii-litvinov/gists{/gist_id}","starred_url":"https://api.github.com/users/yurii-litvinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurii-litvinov/subscriptions","organizations_url":"https://api.github.com/users/yurii-litvinov/orgs","repos_url":"https://api.github.com/users/yurii-litvinov/repos","events_url":"https://api.github.com/users/yurii-litvinov/events{/privacy}","received_events_url":"https://api.github.com/users/yurii-litvinov/received_events","type":"User","site_admin":false},"body":"Такие тесты довольно мало что проверяют","created_at":"2016-12-30T12:09:10Z","updated_at":"2016-12-30T12:09:47Z","html_url":"https://github.com/imbd/SoftwareDesign/pull/8#discussion_r94223166","pull_request_url":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/comments/94223166"},"html":{"href":"https://github.com/imbd/SoftwareDesign/pull/8#discussion_r94223166"},"pull_request":{"href":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/8","id":99305535,"html_url":"https://github.com/imbd/SoftwareDesign/pull/8","diff_url":"https://github.com/imbd/SoftwareDesign/pull/8.diff","patch_url":"https://github.com/imbd/SoftwareDesign/pull/8.patch","issue_url":"https://api.github.com/repos/imbd/SoftwareDesign/issues/8","number":8,"state":"open","locked":false,"title":"11-roguelike","user":{"login":"imbd","id":11520822,"avatar_url":"https://avatars.githubusercontent.com/u/11520822?v=3","gravatar_id":"","url":"https://api.github.com/users/imbd","html_url":"https://github.com/imbd","followers_url":"https://api.github.com/users/imbd/followers","following_url":"https://api.github.com/users/imbd/following{/other_user}","gists_url":"https://api.github.com/users/imbd/gists{/gist_id}","starred_url":"https://api.github.com/users/imbd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imbd/subscriptions","organizations_url":"https://api.github.com/users/imbd/orgs","repos_url":"https://api.github.com/users/imbd/repos","events_url":"https://api.github.com/users/imbd/events{/privacy}","received_events_url":"https://api.github.com/users/imbd/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-24T15:11:33Z","updated_at":"2016-12-30T12:09:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a18bc62390b94629841410c975b0099a4b01ac50","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/8/commits","review_comments_url":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/8/comments","review_comment_url":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/comments{/number}","comments_url":"https://api.github.com/repos/imbd/SoftwareDesign/issues/8/comments","statuses_url":"https://api.github.com/repos/imbd/SoftwareDesign/statuses/3787f0566d61475df4fa2d8d1cdd06b483316696","head":{"label":"imbd:11-roguelike","ref":"11-roguelike","sha":"3787f0566d61475df4fa2d8d1cdd06b483316696","user":{"login":"imbd","id":11520822,"avatar_url":"https://avatars.githubusercontent.com/u/11520822?v=3","gravatar_id":"","url":"https://api.github.com/users/imbd","html_url":"https://github.com/imbd","followers_url":"https://api.github.com/users/imbd/followers","following_url":"https://api.github.com/users/imbd/following{/other_user}","gists_url":"https://api.github.com/users/imbd/gists{/gist_id}","starred_url":"https://api.github.com/users/imbd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imbd/subscriptions","organizations_url":"https://api.github.com/users/imbd/orgs","repos_url":"https://api.github.com/users/imbd/repos","events_url":"https://api.github.com/users/imbd/events{/privacy}","received_events_url":"https://api.github.com/users/imbd/received_events","type":"User","site_admin":false},"repo":{"id":75556806,"name":"SoftwareDesign","full_name":"imbd/SoftwareDesign","owner":{"login":"imbd","id":11520822,"avatar_url":"https://avatars.githubusercontent.com/u/11520822?v=3","gravatar_id":"","url":"https://api.github.com/users/imbd","html_url":"https://github.com/imbd","followers_url":"https://api.github.com/users/imbd/followers","following_url":"https://api.github.com/users/imbd/following{/other_user}","gists_url":"https://api.github.com/users/imbd/gists{/gist_id}","starred_url":"https://api.github.com/users/imbd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imbd/subscriptions","organizations_url":"https://api.github.com/users/imbd/orgs","repos_url":"https://api.github.com/users/imbd/repos","events_url":"https://api.github.com/users/imbd/events{/privacy}","received_events_url":"https://api.github.com/users/imbd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imbd/SoftwareDesign","description":null,"fork":false,"url":"https://api.github.com/repos/imbd/SoftwareDesign","forks_url":"https://api.github.com/repos/imbd/SoftwareDesign/forks","keys_url":"https://api.github.com/repos/imbd/SoftwareDesign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imbd/SoftwareDesign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imbd/SoftwareDesign/teams","hooks_url":"https://api.github.com/repos/imbd/SoftwareDesign/hooks","issue_events_url":"https://api.github.com/repos/imbd/SoftwareDesign/issues/events{/number}","events_url":"https://api.github.com/repos/imbd/SoftwareDesign/events","assignees_url":"https://api.github.com/repos/imbd/SoftwareDesign/assignees{/user}","branches_url":"https://api.github.com/repos/imbd/SoftwareDesign/branches{/branch}","tags_url":"https://api.github.com/repos/imbd/SoftwareDesign/tags","blobs_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/refs{/sha}","trees_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imbd/SoftwareDesign/statuses/{sha}","languages_url":"https://api.github.com/repos/imbd/SoftwareDesign/languages","stargazers_url":"https://api.github.com/repos/imbd/SoftwareDesign/stargazers","contributors_url":"https://api.github.com/repos/imbd/SoftwareDesign/contributors","subscribers_url":"https://api.github.com/repos/imbd/SoftwareDesign/subscribers","subscription_url":"https://api.github.com/repos/imbd/SoftwareDesign/subscription","commits_url":"https://api.github.com/repos/imbd/SoftwareDesign/commits{/sha}","git_commits_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/commits{/sha}","comments_url":"https://api.github.com/repos/imbd/SoftwareDesign/comments{/number}","issue_comment_url":"https://api.github.com/repos/imbd/SoftwareDesign/issues/comments{/number}","contents_url":"https://api.github.com/repos/imbd/SoftwareDesign/contents/{+path}","compare_url":"https://api.github.com/repos/imbd/SoftwareDesign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imbd/SoftwareDesign/merges","archive_url":"https://api.github.com/repos/imbd/SoftwareDesign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imbd/SoftwareDesign/downloads","issues_url":"https://api.github.com/repos/imbd/SoftwareDesign/issues{/number}","pulls_url":"https://api.github.com/repos/imbd/SoftwareDesign/pulls{/number}","milestones_url":"https://api.github.com/repos/imbd/SoftwareDesign/milestones{/number}","notifications_url":"https://api.github.com/repos/imbd/SoftwareDesign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imbd/SoftwareDesign/labels{/name}","releases_url":"https://api.github.com/repos/imbd/SoftwareDesign/releases{/id}","deployments_url":"https://api.github.com/repos/imbd/SoftwareDesign/deployments","created_at":"2016-12-04T18:46:55Z","updated_at":"2016-12-04T18:46:55Z","pushed_at":"2016-12-29T22:19:20Z","git_url":"git://github.com/imbd/SoftwareDesign.git","ssh_url":"git@github.com:imbd/SoftwareDesign.git","clone_url":"https://github.com/imbd/SoftwareDesign.git","svn_url":"https://github.com/imbd/SoftwareDesign","homepage":null,"size":7774,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"imbd:master","ref":"master","sha":"0cd903106b8601103cd377679749b54011a8f4d0","user":{"login":"imbd","id":11520822,"avatar_url":"https://avatars.githubusercontent.com/u/11520822?v=3","gravatar_id":"","url":"https://api.github.com/users/imbd","html_url":"https://github.com/imbd","followers_url":"https://api.github.com/users/imbd/followers","following_url":"https://api.github.com/users/imbd/following{/other_user}","gists_url":"https://api.github.com/users/imbd/gists{/gist_id}","starred_url":"https://api.github.com/users/imbd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imbd/subscriptions","organizations_url":"https://api.github.com/users/imbd/orgs","repos_url":"https://api.github.com/users/imbd/repos","events_url":"https://api.github.com/users/imbd/events{/privacy}","received_events_url":"https://api.github.com/users/imbd/received_events","type":"User","site_admin":false},"repo":{"id":75556806,"name":"SoftwareDesign","full_name":"imbd/SoftwareDesign","owner":{"login":"imbd","id":11520822,"avatar_url":"https://avatars.githubusercontent.com/u/11520822?v=3","gravatar_id":"","url":"https://api.github.com/users/imbd","html_url":"https://github.com/imbd","followers_url":"https://api.github.com/users/imbd/followers","following_url":"https://api.github.com/users/imbd/following{/other_user}","gists_url":"https://api.github.com/users/imbd/gists{/gist_id}","starred_url":"https://api.github.com/users/imbd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imbd/subscriptions","organizations_url":"https://api.github.com/users/imbd/orgs","repos_url":"https://api.github.com/users/imbd/repos","events_url":"https://api.github.com/users/imbd/events{/privacy}","received_events_url":"https://api.github.com/users/imbd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imbd/SoftwareDesign","description":null,"fork":false,"url":"https://api.github.com/repos/imbd/SoftwareDesign","forks_url":"https://api.github.com/repos/imbd/SoftwareDesign/forks","keys_url":"https://api.github.com/repos/imbd/SoftwareDesign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imbd/SoftwareDesign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imbd/SoftwareDesign/teams","hooks_url":"https://api.github.com/repos/imbd/SoftwareDesign/hooks","issue_events_url":"https://api.github.com/repos/imbd/SoftwareDesign/issues/events{/number}","events_url":"https://api.github.com/repos/imbd/SoftwareDesign/events","assignees_url":"https://api.github.com/repos/imbd/SoftwareDesign/assignees{/user}","branches_url":"https://api.github.com/repos/imbd/SoftwareDesign/branches{/branch}","tags_url":"https://api.github.com/repos/imbd/SoftwareDesign/tags","blobs_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/refs{/sha}","trees_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imbd/SoftwareDesign/statuses/{sha}","languages_url":"https://api.github.com/repos/imbd/SoftwareDesign/languages","stargazers_url":"https://api.github.com/repos/imbd/SoftwareDesign/stargazers","contributors_url":"https://api.github.com/repos/imbd/SoftwareDesign/contributors","subscribers_url":"https://api.github.com/repos/imbd/SoftwareDesign/subscribers","subscription_url":"https://api.github.com/repos/imbd/SoftwareDesign/subscription","commits_url":"https://api.github.com/repos/imbd/SoftwareDesign/commits{/sha}","git_commits_url":"https://api.github.com/repos/imbd/SoftwareDesign/git/commits{/sha}","comments_url":"https://api.github.com/repos/imbd/SoftwareDesign/comments{/number}","issue_comment_url":"https://api.github.com/repos/imbd/SoftwareDesign/issues/comments{/number}","contents_url":"https://api.github.com/repos/imbd/SoftwareDesign/contents/{+path}","compare_url":"https://api.github.com/repos/imbd/SoftwareDesign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imbd/SoftwareDesign/merges","archive_url":"https://api.github.com/repos/imbd/SoftwareDesign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imbd/SoftwareDesign/downloads","issues_url":"https://api.github.com/repos/imbd/SoftwareDesign/issues{/number}","pulls_url":"https://api.github.com/repos/imbd/SoftwareDesign/pulls{/number}","milestones_url":"https://api.github.com/repos/imbd/SoftwareDesign/milestones{/number}","notifications_url":"https://api.github.com/repos/imbd/SoftwareDesign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imbd/SoftwareDesign/labels{/name}","releases_url":"https://api.github.com/repos/imbd/SoftwareDesign/releases{/id}","deployments_url":"https://api.github.com/repos/imbd/SoftwareDesign/deployments","created_at":"2016-12-04T18:46:55Z","updated_at":"2016-12-04T18:46:55Z","pushed_at":"2016-12-29T22:19:20Z","git_url":"git://github.com/imbd/SoftwareDesign.git","ssh_url":"git@github.com:imbd/SoftwareDesign.git","clone_url":"https://github.com/imbd/SoftwareDesign.git","svn_url":"https://github.com/imbd/SoftwareDesign","homepage":null,"size":7774,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/8"},"html":{"href":"https://github.com/imbd/SoftwareDesign/pull/8"},"issue":{"href":"https://api.github.com/repos/imbd/SoftwareDesign/issues/8"},"comments":{"href":"https://api.github.com/repos/imbd/SoftwareDesign/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/imbd/SoftwareDesign/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/imbd/SoftwareDesign/statuses/3787f0566d61475df4fa2d8d1cdd06b483316696"}}}}
{"actor":{"display_login":"yurii-litvinov"}}