GitHub PullRequestReviewCommentEvent at 2014-03-01 19:56:39
Repository: 3303Bomberman
Actor: oharaandrew314
Payload: {"comment":{"url":"https://api.github.com/repos/oharaandrew314/3303Bomberman/pulls/comments/10192196","id":10192196,"diff_hunk":"@@ -0,0 +1,144 @@\n+package controllers;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertTrue;\n+\n+import java.awt.Dimension;\n+import java.awt.Point;\n+import java.util.HashSet;\n+import java.util.Set;\n+\n+import org.junit.Test;\n+\n+import server.controllers.GridGenerator;\n+\n+import common.models.Box;\n+import common.models.Door;\n+import common.models.Entity;\n+import common.models.Grid;\n+import common.models.Player;\n+\n+public class TestGridGenerator {\n+\t\n+\tprivate static final int MAX_DOORS = 1;\n+\t\n+\t@Test\n+\tpublic void testRandom1(){\n+\t\tint seed = 123456789, numPlayers = 1;\n+\t\tGrid grid = GridGenerator.createRandomGrid(\n+\t\t\tnew Dimension(4, 4), numPlayers, seed\n+\t\t);\n+\t\ttestGrid(grid, numPlayers);\n+\t}\n+\t\n+\t@Test\n+\tpublic void testRandom2(){\n+\t\tint seed = 987654321, numPlayers = 1;\n+\t\tGrid grid = GridGenerator.createRandomGrid(\n+\t\t\tnew Dimension(4, 6), numPlayers, seed\n+\t\t);\n+\t\ttestGrid(grid, numPlayers);\n+\t}\n+\t\n+\t@Test\n+\tpublic void testRandom3(){\n+\t\tint seed = 135792468, numPlayers = 2;\n+\t\tGrid grid = GridGenerator.createRandomGrid(\n+\t\t\tnew Dimension(3, 5), numPlayers, seed\n+\t\t);\n+\t\ttestGrid(grid, numPlayers);\n+\t}\n+\t\n+\t@Test\n+\tpublic void testRandom4(){\n+\t\tint seed = 135792468, numPlayers = 4;\n+\t\tGrid grid = GridGenerator.createRandomGrid(\n+\t\t\tnew Dimension(10, 10), numPlayers, seed\n+\t\t);\n+\t\ttestGrid(grid, numPlayers);\n+\t}\n+\n+\t\n+\t// Helpers\n+\t\n+\tprivate void testGrid(Grid grid, int expectedNumPlayers){\n+\t\ttestPillars(grid);\n+\t\ttestWalls(grid);\n+\t\ttestDoor(grid);\n+\t\ttestPlayers(grid, expectedNumPlayers);\n+\t}\n+\t\n+\tprivate void testWalls(Grid grid) {\n+\t\tint numWalls = 0;\n+\t\tfor (Entity entity : getEntities(grid)){\n+\t\t\tif (entity instanceof Box && ((Box)entity).isDestructible()){","path":"test/controllers/TestGridGenerator.java","position":74,"original_position":74,"commit_id":"e97a9e0645aff9c11e2c4fe0ce006a3a2cb9a33d","original_commit_id":"dc13041eb167d444feef3be4ee9167b4f53eafbd","user":{"login":"oharaandrew314","id":894152,"avatar_url":"https://avatars.githubusercontent.com/u/894152","gravatar_id":"7b25756375b9bfccb590e90ca4b195f3","url":"https://api.github.com/users/oharaandrew314","html_url":"https://github.com/oharaandrew314","followers_url":"https://api.github.com/users/oharaandrew314/followers","following_url":"https://api.github.com/users/oharaandrew314/following{/other_user}","gists_url":"https://api.github.com/users/oharaandrew314/gists{/gist_id}","starred_url":"https://api.github.com/users/oharaandrew314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oharaandrew314/subscriptions","organizations_url":"https://api.github.com/users/oharaandrew314/orgs","repos_url":"https://api.github.com/users/oharaandrew314/repos","events_url":"https://api.github.com/users/oharaandrew314/events{/privacy}","received_events_url":"https://api.github.com/users/oharaandrew314/received_events","type":"User","site_admin":false},"body":"Crap.","created_at":"2014-03-01T19:56:39Z","updated_at":"2014-03-01T19:56:39Z","html_url":"https://github.com/oharaandrew314/3303Bomberman/pull/21#discussion_r10192196","pull_request_url":"https://api.github.com/repos/oharaandrew314/3303Bomberman/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/oharaandrew314/3303Bomberman/pulls/comments/10192196"},"html":{"href":"https://github.com/oharaandrew314/3303Bomberman/pull/21#discussion_r10192196"},"pull_request":{"href":"https://api.github.com/repos/oharaandrew314/3303Bomberman/pulls/21"}}}}