{"action":"created","comment":{"url":"https://api.github.com/repos/laboon/JavaLife/pulls/comments/27899962","id":27899962,"diff_hunk":"@@ -0,0 +1,110 @@\n+package tests;\n+\n+import com.laboon.*;\n+import static org.junit.Assert.*;\n+\n+import org.junit.Test;\n+\n+public class WorldTests {\n+\n+\t/* Tests to make sure that the columns are numbered correctly */\n+\t@Test\n+\tpublic void testToString_columns() {\n+\t\tString expectedColumns = \"  012345678901234\";\n+\t\tWorld testWorld = new World(15, 0xDEADBEEF, 30);\n+\t\tString worldState = testWorld.toString();\n+\t\tString observedColumns = worldState.split(\"\\n\")[0];\n+\t\tassertEquals(observedColumns, expectedColumns);\n+\t}\n+\t\n+\t/* Tests to make sure that the rows are numbered correctly */\n+\t@Test\n+\tpublic void testToString_rows() {\n+\t\tString expectedRows = \"012345678901234\";\n+\t\tWorld testWorld = new World(15, 0xDEADBEEF, 30);\n+\t\tString worldState = testWorld.toString();\n+\t\tString[] lines = worldState.split(\"\\n\");\n+\t\tString observedRows = \"\";\n+\t\tfor (int i = 1; i < lines.length; i++) {\n+\t\t\tobservedRows += lines[i].charAt(0);\n+\t\t}\n+\t\tassertEquals(observedRows, expectedRows);\n+\t}\n+\t\n+\t/* Tests a 1x1 world to make sure it renders correctly */\n+\t@Test\n+\tpublic void testToString_smallBoard() {\n+\t\tString expectedWorld = \"  0\\n0 .\\n\";\n+\t\tWorld testWorld = new World(1, 0xDEADBEEF, 30);\n+\t\tString observedWorld = testWorld.toString();\n+\t\tassertEquals(observedWorld, expectedWorld);\n+\t}\n+\t\n+\t/* Tests a 15x15 world to make sure it renders correctly */\n+\t@Test\n+\tpublic void testToString_largeBoard() {\n+\t\tString expectedWorld = \"  012345678901234\\n\" +\n+\t\t\t\t\"0 ...XX.X.XX...X.\\n\" +\n+\t\t\t\t\"1 .....X.XX...X..\\n\" +\n+\t\t\t\t\"2 ....XX.XX.X...X\\n\" +\n+\t\t\t\t\"3 ...XXXX.XX.XX..\\n\" +\n+\t\t\t\t\"4 X..X.X...X...X.\\n\" +\n+\t\t\t\t\"5 X...........XXX\\n\" +\n+\t\t\t\t\"6 ..X.XX..X......\\n\" +\n+\t\t\t\t\"7 .X..........X..\\n\" +\n+\t\t\t\t\"8 X..XXX....XX.X.\\n\" +\n+\t\t\t\t\"9 ..X...X..X....X\\n\" +\n+\t\t\t\t\"0 X.X..X....X....\\n\" +\n+\t\t\t\t\"1 X..X..XX..X....\\n\" +\n+\t\t\t\t\"2 .X..XX.....XXX.\\n\" +\n+\t\t\t\t\"3 XX.X.....X.XX..\\n\" +\n+\t\t\t\t\"4 .X......X.XXXX.\\n\";\n+\t\tWorld testWorld = new World(15, 0xDEADBEEF, 30);\n+\t\tString observedWorld = testWorld.toString();\n+\t\tassertEquals(observedWorld, expectedWorld);\n+\t}\n+\t/* Tests a 10x10 world after 1 iteration to make sure it renders correctly */\n+\t@Test\n+\tpublic void testToString_singleIteration() {\n+\t\tString expectedWorld = \"  0123456789\\n\" +\n+\t\t\t\t\"0 ..X....XXX\\n\" +\n+\t\t\t\t\"1 .......XXX\\n\" +\n+\t\t\t\t\"2 ..XX..XXX.\\n\" +\n+\t\t\t\t\"3 XX..XXXX..\\n\" +\n+\t\t\t\t\"4 XX........\\n\" +\n+\t\t\t\t\"5 .XXX..XX..\\n\" +\n+\t\t\t\t\"6 XX.X.X...X\\n\" +\n+\t\t\t\t\"7 X.....X...\\n\" +\n+\t\t\t\t\"8 ...X.XXXXX\\n\" +\n+\t\t\t\t\"9 ....XXX...\\n\";\n+\t\tWorld testWorld = new World(10, 0xDEADBEEF, 30);\n+\t\ttestWorld = testWorld.iterate();\n+\t\tString observedWorld = testWorld.toString();\n+\t\tassertEquals(observedWorld, expectedWorld);\n+\t}\n+\t\n+\t/* Tests a world that initially has all cells alive*/\n+\t@Test\n+\tpublic void testToString_fullWorld() {\n+\t\tString expectedWorld = \"  012\\n\" +\n+\t\t\t\t\"0 XXX\\n\" +\n+\t\t\t\t\"1 XXX\\n\" +\n+\t\t\t\t\"2 XXX\\n\";\n+\t\tWorld testWorld = new World(3, 0xDEADBEEF, 100);\n+\t\tString observedWorld = testWorld.toString();\n+\t\tassertEquals(observedWorld, expectedWorld);\n+\t}\n+\t\n+\t/* Tests a world that initially has all cells dead */\n+\t@Test\n+\tpublic void testToString_emptyWorld() {\n+\t\tString expectedWorld = \"  012\\n\" +\n+\t\t\t\t\"0 ...\\n\" +\n+\t\t\t\t\"1 ...\\n\" +\n+\t\t\t\t\"2 ...\\n\";\n+\t\tWorld testWorld = new World(3, 0xDEADBEEF, 0);\n+\t\tString observedWorld = testWorld.toString();\n+\n+\t\tassertEquals(observedWorld, expectedWorld);\n+\t}\n+}","path":"tests/WorldTests.java","position":110,"original_position":110,"commit_id":"ad19628163ff2e7a1190c5c5456e868ba37fea43","original_commit_id":"ad19628163ff2e7a1190c5c5456e868ba37fea43","user":{"login":"laboon","id":1417717,"avatar_url":"https://avatars.githubusercontent.com/u/1417717?v=3","gravatar_id":"","url":"https://api.github.com/users/laboon","html_url":"https://github.com/laboon","followers_url":"https://api.github.com/users/laboon/followers","following_url":"https://api.github.com/users/laboon/following{/other_user}","gists_url":"https://api.github.com/users/laboon/gists{/gist_id}","starred_url":"https://api.github.com/users/laboon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laboon/subscriptions","organizations_url":"https://api.github.com/users/laboon/orgs","repos_url":"https://api.github.com/users/laboon/repos","events_url":"https://api.github.com/users/laboon/events{/privacy}","received_events_url":"https://api.github.com/users/laboon/received_events","type":"User","site_admin":false},"body":"very good","created_at":"2015-04-07T17:27:15Z","updated_at":"2015-04-07T17:27:15Z","html_url":"https://github.com/laboon/JavaLife/pull/13#discussion_r27899962","pull_request_url":"https://api.github.com/repos/laboon/JavaLife/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/laboon/JavaLife/pulls/comments/27899962"},"html":{"href":"https://github.com/laboon/JavaLife/pull/13#discussion_r27899962"},"pull_request":{"href":"https://api.github.com/repos/laboon/JavaLife/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/laboon/JavaLife/pulls/13","id":32286609,"html_url":"https://github.com/laboon/JavaLife/pull/13","diff_url":"https://github.com/laboon/JavaLife/pull/13.diff","patch_url":"https://github.com/laboon/JavaLife/pull/13.patch","issue_url":"https://api.github.com/repos/laboon/JavaLife/issues/13","number":13,"state":"open","locked":false,"title":"Hagner","user":{"login":"CaptainMaximum","id":5522255,"avatar_url":"https://avatars.githubusercontent.com/u/5522255?v=3","gravatar_id":"","url":"https://api.github.com/users/CaptainMaximum","html_url":"https://github.com/CaptainMaximum","followers_url":"https://api.github.com/users/CaptainMaximum/followers","following_url":"https://api.github.com/users/CaptainMaximum/following{/other_user}","gists_url":"https://api.github.com/users/CaptainMaximum/gists{/gist_id}","starred_url":"https://api.github.com/users/CaptainMaximum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaptainMaximum/subscriptions","organizations_url":"https://api.github.com/users/CaptainMaximum/orgs","repos_url":"https://api.github.com/users/CaptainMaximum/repos","events_url":"https://api.github.com/users/CaptainMaximum/events{/privacy}","received_events_url":"https://api.github.com/users/CaptainMaximum/received_events","type":"User","site_admin":false},"body":"-Changed the World.toString method to improve its performance.\r\n-Added unit tests to ensure that the new method behaves identically to the old one.\r\n\r\nJoey Hagner","created_at":"2015-03-31T02:41:10Z","updated_at":"2015-04-07T17:27:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c30539da60742843476182005a075f89a40b60a3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/laboon/JavaLife/pulls/13/commits","review_comments_url":"https://api.github.com/repos/laboon/JavaLife/pulls/13/comments","review_comment_url":"https://api.github.com/repos/laboon/JavaLife/pulls/comments{/number}","comments_url":"https://api.github.com/repos/laboon/JavaLife/issues/13/comments","statuses_url":"https://api.github.com/repos/laboon/JavaLife/statuses/ad19628163ff2e7a1190c5c5456e868ba37fea43","head":{"label":"CaptainMaximum:Hagner","ref":"Hagner","sha":"ad19628163ff2e7a1190c5c5456e868ba37fea43","user":{"login":"CaptainMaximum","id":5522255,"avatar_url":"https://avatars.githubusercontent.com/u/5522255?v=3","gravatar_id":"","url":"https://api.github.com/users/CaptainMaximum","html_url":"https://github.com/CaptainMaximum","followers_url":"https://api.github.com/users/CaptainMaximum/followers","following_url":"https://api.github.com/users/CaptainMaximum/following{/other_user}","gists_url":"https://api.github.com/users/CaptainMaximum/gists{/gist_id}","starred_url":"https://api.github.com/users/CaptainMaximum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaptainMaximum/subscriptions","organizations_url":"https://api.github.com/users/CaptainMaximum/orgs","repos_url":"https://api.github.com/users/CaptainMaximum/repos","events_url":"https://api.github.com/users/CaptainMaximum/events{/privacy}","received_events_url":"https://api.github.com/users/CaptainMaximum/received_events","type":"User","site_admin":false},"repo":{"id":33057643,"name":"JavaLife","full_name":"CaptainMaximum/JavaLife","owner":{"login":"CaptainMaximum","id":5522255,"avatar_url":"https://avatars.githubusercontent.com/u/5522255?v=3","gravatar_id":"","url":"https://api.github.com/users/CaptainMaximum","html_url":"https://github.com/CaptainMaximum","followers_url":"https://api.github.com/users/CaptainMaximum/followers","following_url":"https://api.github.com/users/CaptainMaximum/following{/other_user}","gists_url":"https://api.github.com/users/CaptainMaximum/gists{/gist_id}","starred_url":"https://api.github.com/users/CaptainMaximum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaptainMaximum/subscriptions","organizations_url":"https://api.github.com/users/CaptainMaximum/orgs","repos_url":"https://api.github.com/users/CaptainMaximum/repos","events_url":"https://api.github.com/users/CaptainMaximum/events{/privacy}","received_events_url":"https://api.github.com/users/CaptainMaximum/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CaptainMaximum/JavaLife","description":"A (deliberately inefficient) version of Conway's Game of Life","fork":true,"url":"https://api.github.com/repos/CaptainMaximum/JavaLife","forks_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/forks","keys_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/teams","hooks_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/hooks","issue_events_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/issues/events{/number}","events_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/events","assignees_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/assignees{/user}","branches_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/branches{/branch}","tags_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/tags","blobs_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/git/refs{/sha}","trees_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/statuses/{sha}","languages_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/languages","stargazers_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/stargazers","contributors_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/contributors","subscribers_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/subscribers","subscription_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/subscription","commits_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/commits{/sha}","git_commits_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/git/commits{/sha}","comments_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/comments{/number}","issue_comment_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/issues/comments{/number}","contents_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/contents/{+path}","compare_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/merges","archive_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/downloads","issues_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/issues{/number}","pulls_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/pulls{/number}","milestones_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/milestones{/number}","notifications_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/labels{/name}","releases_url":"https://api.github.com/repos/CaptainMaximum/JavaLife/releases{/id}","created_at":"2015-03-29T01:51:35Z","updated_at":"2015-03-29T01:51:35Z","pushed_at":"2015-03-31T02:39:14Z","git_url":"git://github.com/CaptainMaximum/JavaLife.git","ssh_url":"git@github.com:CaptainMaximum/JavaLife.git","clone_url":"https://github.com/CaptainMaximum/JavaLife.git","svn_url":"https://github.com/CaptainMaximum/JavaLife","homepage":null,"size":89,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"laboon:master","ref":"master","sha":"37f3026c08c494c9608df43a44793de3a9be2782","user":{"login":"laboon","id":1417717,"avatar_url":"https://avatars.githubusercontent.com/u/1417717?v=3","gravatar_id":"","url":"https://api.github.com/users/laboon","html_url":"https://github.com/laboon","followers_url":"https://api.github.com/users/laboon/followers","following_url":"https://api.github.com/users/laboon/following{/other_user}","gists_url":"https://api.github.com/users/laboon/gists{/gist_id}","starred_url":"https://api.github.com/users/laboon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laboon/subscriptions","organizations_url":"https://api.github.com/users/laboon/orgs","repos_url":"https://api.github.com/users/laboon/repos","events_url":"https://api.github.com/users/laboon/events{/privacy}","received_events_url":"https://api.github.com/users/laboon/received_events","type":"User","site_admin":false},"repo":{"id":32392759,"name":"JavaLife","full_name":"laboon/JavaLife","owner":{"login":"laboon","id":1417717,"avatar_url":"https://avatars.githubusercontent.com/u/1417717?v=3","gravatar_id":"","url":"https://api.github.com/users/laboon","html_url":"https://github.com/laboon","followers_url":"https://api.github.com/users/laboon/followers","following_url":"https://api.github.com/users/laboon/following{/other_user}","gists_url":"https://api.github.com/users/laboon/gists{/gist_id}","starred_url":"https://api.github.com/users/laboon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laboon/subscriptions","organizations_url":"https://api.github.com/users/laboon/orgs","repos_url":"https://api.github.com/users/laboon/repos","events_url":"https://api.github.com/users/laboon/events{/privacy}","received_events_url":"https://api.github.com/users/laboon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/laboon/JavaLife","description":"A (deliberately inefficient) version of Conway's Game of Life","fork":false,"url":"https://api.github.com/repos/laboon/JavaLife","forks_url":"https://api.github.com/repos/laboon/JavaLife/forks","keys_url":"https://api.github.com/repos/laboon/JavaLife/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laboon/JavaLife/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laboon/JavaLife/teams","hooks_url":"https://api.github.com/repos/laboon/JavaLife/hooks","issue_events_url":"https://api.github.com/repos/laboon/JavaLife/issues/events{/number}","events_url":"https://api.github.com/repos/laboon/JavaLife/events","assignees_url":"https://api.github.com/repos/laboon/JavaLife/assignees{/user}","branches_url":"https://api.github.com/repos/laboon/JavaLife/branches{/branch}","tags_url":"https://api.github.com/repos/laboon/JavaLife/tags","blobs_url":"https://api.github.com/repos/laboon/JavaLife/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laboon/JavaLife/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laboon/JavaLife/git/refs{/sha}","trees_url":"https://api.github.com/repos/laboon/JavaLife/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laboon/JavaLife/statuses/{sha}","languages_url":"https://api.github.com/repos/laboon/JavaLife/languages","stargazers_url":"https://api.github.com/repos/laboon/JavaLife/stargazers","contributors_url":"https://api.github.com/repos/laboon/JavaLife/contributors","subscribers_url":"https://api.github.com/repos/laboon/JavaLife/subscribers","subscription_url":"https://api.github.com/repos/laboon/JavaLife/subscription","commits_url":"https://api.github.com/repos/laboon/JavaLife/commits{/sha}","git_commits_url":"https://api.github.com/repos/laboon/JavaLife/git/commits{/sha}","comments_url":"https://api.github.com/repos/laboon/JavaLife/comments{/number}","issue_comment_url":"https://api.github.com/repos/laboon/JavaLife/issues/comments{/number}","contents_url":"https://api.github.com/repos/laboon/JavaLife/contents/{+path}","compare_url":"https://api.github.com/repos/laboon/JavaLife/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laboon/JavaLife/merges","archive_url":"https://api.github.com/repos/laboon/JavaLife/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laboon/JavaLife/downloads","issues_url":"https://api.github.com/repos/laboon/JavaLife/issues{/number}","pulls_url":"https://api.github.com/repos/laboon/JavaLife/pulls{/number}","milestones_url":"https://api.github.com/repos/laboon/JavaLife/milestones{/number}","notifications_url":"https://api.github.com/repos/laboon/JavaLife/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laboon/JavaLife/labels{/name}","releases_url":"https://api.github.com/repos/laboon/JavaLife/releases{/id}","created_at":"2015-03-17T12:45:18Z","updated_at":"2015-03-18T00:27:38Z","pushed_at":"2015-04-06T00:25:16Z","git_url":"git://github.com/laboon/JavaLife.git","ssh_url":"git@github.com:laboon/JavaLife.git","clone_url":"https://github.com/laboon/JavaLife.git","svn_url":"https://github.com/laboon/JavaLife","homepage":null,"size":1989,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":36,"forks":36,"open_issues":36,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/laboon/JavaLife/pulls/13"},"html":{"href":"https://github.com/laboon/JavaLife/pull/13"},"issue":{"href":"https://api.github.com/repos/laboon/JavaLife/issues/13"},"comments":{"href":"https://api.github.com/repos/laboon/JavaLife/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/laboon/JavaLife/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/laboon/JavaLife/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/laboon/JavaLife/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/laboon/JavaLife/statuses/ad19628163ff2e7a1190c5c5456e868ba37fea43"}}}}