{"action":"created","comment":{"url":"https://api.github.com/repos/connorlay/magical-cards/pulls/comments/90954126","pull_request_review_id":11467564,"id":90954126,"diff_hunk":"@@ -4,34 +4,115 @@ import Test exposing (..)\n import Expect\n import Fuzz exposing (list, int, tuple, string)\n import String\n+import Library.Library exposing (..)\n+import Hand.Hand exposing (..)\n+import Card exposing (..)\n+import MagicalCards exposing (..)\n \n \n all : Test\n all =\n-    describe \"Sample Test Suite\"\n-        [ describe \"Unit test examples\"\n-            [ test \"Addition\" <|\n+    Test.concat [ library, hand, cardMovement ]\n+\n+\n+cardMovement : Test\n+cardMovement =\n+    describe \"Cards moving between zones\"\n+        [ describe \"drawing a card\"\n+            [ test \"a single card\" <|\n+                \\() ->\n+                    let\n+                        initial =\n+                            { library = [ Card \"a\", Card \"b\", Card \"c\" ]\n+                            , hand = [ Card \"h\" ]\n+                            }\n+\n+                        expected =\n+                            { library = [ Card \"b\", Card \"c\" ]\n+                            , hand = [ Card \"a\", Card \"h\" ]\n+                            }\n+                    in\n+                        Expect.equal expected <| drawCard initial\n+            ]\n+        ]\n+\n+\n+library : Test\n+library =\n+    describe \"Library module\"\n+        [ describe \"removing a card\"\n+            [ describe \"from the top\"\n+                [ test \"non-empty library\" <|\n+                    \\() ->\n+                        let\n+                            library =\n+                                [ Card \"a\", Card \"b\", Card \"c\" ]\n+                        in\n+                            Expect.equal ( Just (Card \"a\"), [ Card \"b\", Card \"c\" ] ) <|\n+                                pop library\n+                , test \"empty library\" <|\n+                    \\() ->\n+                        Expect.equal ( Nothing, [] ) <| pop []\n+                ]\n+            , describe \"by name\" <|\n+                [ test \"card is present\" <|\n+                    \\() ->\n+                        let\n+                            library =\n+                                [ Card \"a\", Card \"b\", Card \"c\" ]\n+                        in\n+                            Expect.equal ( Just (Card \"b\"), [ Card \"a\", Card \"c\" ] ) <|\n+                                Library.Library.removeByName \"b\" library\n+                , test \"card is not present\" <|\n+                    \\() ->\n+                        let\n+                            library =\n+                                [ Card \"a\", Card \"b\" ]\n+                        in\n+                            Expect.equal ( Nothing, [ Card \"a\", Card \"b\" ] ) <|\n+                                Library.Library.removeByName \"c\" library\n+                ]\n+            ]\n+        , describe \"adding a card\"\n+            [ test \"to the top\" <|\n                 \\() ->\n-                    Expect.equal (3 + 7) 10\n-            , test \"String.left\" <|\n+                    let\n+                        library =\n+                            [ Card \"a\", Card \"b\", Card \"c\" ]\n+                    in\n+                        Expect.equal (Card \"d\" :: library) <|\n+                            pushTop (Card \"d\") library\n+            , test \"to the bottom\" <|\n                 \\() ->\n-                    Expect.equal \"a\" (String.left 1 \"abcdefg\")\n-            , test \"This test should fail - you should remove it\" <|\n+                    let\n+                        library =\n+                            [ Card \"a\", Card \"b\", Card \"c\" ]\n+                    in\n+                        Expect.equal (library ++ [ Card \"d\" ]) <|\n+                            pushBottom (Card \"d\") library\n+            ]\n+        ]\n+\n+\n+hand : Test\n+hand =","path":"tests/Tests.elm","position":102,"original_position":102,"commit_id":"a70388b5502e93f29ee51ca7dd8e3ff9e5d048fc","original_commit_id":"a70388b5502e93f29ee51ca7dd8e3ff9e5d048fc","user":{"login":"connorlay","id":6548350,"avatar_url":"https://avatars.githubusercontent.com/u/6548350?v=3","gravatar_id":"","url":"https://api.github.com/users/connorlay","html_url":"https://github.com/connorlay","followers_url":"https://api.github.com/users/connorlay/followers","following_url":"https://api.github.com/users/connorlay/following{/other_user}","gists_url":"https://api.github.com/users/connorlay/gists{/gist_id}","starred_url":"https://api.github.com/users/connorlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connorlay/subscriptions","organizations_url":"https://api.github.com/users/connorlay/orgs","repos_url":"https://api.github.com/users/connorlay/repos","events_url":"https://api.github.com/users/connorlay/events{/privacy}","received_events_url":"https://api.github.com/users/connorlay/received_events","type":"User","site_admin":false},"body":"This should probably live in a separate test file. `HandTests.elm`?","created_at":"2016-12-05T21:00:58Z","updated_at":"2016-12-05T21:03:01Z","html_url":"https://github.com/connorlay/magical-cards/pull/10#discussion_r90954126","pull_request_url":"https://api.github.com/repos/connorlay/magical-cards/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/connorlay/magical-cards/pulls/comments/90954126"},"html":{"href":"https://github.com/connorlay/magical-cards/pull/10#discussion_r90954126"},"pull_request":{"href":"https://api.github.com/repos/connorlay/magical-cards/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/connorlay/magical-cards/pulls/10","id":96449520,"html_url":"https://github.com/connorlay/magical-cards/pull/10","diff_url":"https://github.com/connorlay/magical-cards/pull/10.diff","patch_url":"https://github.com/connorlay/magical-cards/pull/10.patch","issue_url":"https://api.github.com/repos/connorlay/magical-cards/issues/10","number":10,"state":"open","locked":false,"title":"(WIP) (#5) Hand model","user":{"login":"Magisus","id":839145,"avatar_url":"https://avatars.githubusercontent.com/u/839145?v=3","gravatar_id":"","url":"https://api.github.com/users/Magisus","html_url":"https://github.com/Magisus","followers_url":"https://api.github.com/users/Magisus/followers","following_url":"https://api.github.com/users/Magisus/following{/other_user}","gists_url":"https://api.github.com/users/Magisus/gists{/gist_id}","starred_url":"https://api.github.com/users/Magisus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Magisus/subscriptions","organizations_url":"https://api.github.com/users/Magisus/orgs","repos_url":"https://api.github.com/users/Magisus/repos","events_url":"https://api.github.com/users/Magisus/events{/privacy}","received_events_url":"https://api.github.com/users/Magisus/received_events","type":"User","site_admin":false},"body":"This is based of the as-yet unmerged library work. It refactors some of the string utility functions into a separate module.\r\n\r\nThis is still incomplete, but I wanted the branch to be accessible, and the merge state of the [underlying branch](https://github.com/connorlay/magical-cards/tree/library-model/4) to be tracked.","created_at":"2016-12-04T22:22:48Z","updated_at":"2016-12-05T21:06:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d01b75e488214fa45bdc890815c173499e3dacbd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/connorlay/magical-cards/pulls/10/commits","review_comments_url":"https://api.github.com/repos/connorlay/magical-cards/pulls/10/comments","review_comment_url":"https://api.github.com/repos/connorlay/magical-cards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/connorlay/magical-cards/issues/10/comments","statuses_url":"https://api.github.com/repos/connorlay/magical-cards/statuses/a70388b5502e93f29ee51ca7dd8e3ff9e5d048fc","head":{"label":"Magisus:hand-model/5","ref":"hand-model/5","sha":"a70388b5502e93f29ee51ca7dd8e3ff9e5d048fc","user":{"login":"Magisus","id":839145,"avatar_url":"https://avatars.githubusercontent.com/u/839145?v=3","gravatar_id":"","url":"https://api.github.com/users/Magisus","html_url":"https://github.com/Magisus","followers_url":"https://api.github.com/users/Magisus/followers","following_url":"https://api.github.com/users/Magisus/following{/other_user}","gists_url":"https://api.github.com/users/Magisus/gists{/gist_id}","starred_url":"https://api.github.com/users/Magisus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Magisus/subscriptions","organizations_url":"https://api.github.com/users/Magisus/orgs","repos_url":"https://api.github.com/users/Magisus/repos","events_url":"https://api.github.com/users/Magisus/events{/privacy}","received_events_url":"https://api.github.com/users/Magisus/received_events","type":"User","site_admin":false},"repo":{"id":73890217,"name":"magical-cards","full_name":"Magisus/magical-cards","owner":{"login":"Magisus","id":839145,"avatar_url":"https://avatars.githubusercontent.com/u/839145?v=3","gravatar_id":"","url":"https://api.github.com/users/Magisus","html_url":"https://github.com/Magisus","followers_url":"https://api.github.com/users/Magisus/followers","following_url":"https://api.github.com/users/Magisus/following{/other_user}","gists_url":"https://api.github.com/users/Magisus/gists{/gist_id}","starred_url":"https://api.github.com/users/Magisus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Magisus/subscriptions","organizations_url":"https://api.github.com/users/Magisus/orgs","repos_url":"https://api.github.com/users/Magisus/repos","events_url":"https://api.github.com/users/Magisus/events{/privacy}","received_events_url":"https://api.github.com/users/Magisus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Magisus/magical-cards","description":"A simple MTG client built with Elm and Electron.","fork":true,"url":"https://api.github.com/repos/Magisus/magical-cards","forks_url":"https://api.github.com/repos/Magisus/magical-cards/forks","keys_url":"https://api.github.com/repos/Magisus/magical-cards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Magisus/magical-cards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Magisus/magical-cards/teams","hooks_url":"https://api.github.com/repos/Magisus/magical-cards/hooks","issue_events_url":"https://api.github.com/repos/Magisus/magical-cards/issues/events{/number}","events_url":"https://api.github.com/repos/Magisus/magical-cards/events","assignees_url":"https://api.github.com/repos/Magisus/magical-cards/assignees{/user}","branches_url":"https://api.github.com/repos/Magisus/magical-cards/branches{/branch}","tags_url":"https://api.github.com/repos/Magisus/magical-cards/tags","blobs_url":"https://api.github.com/repos/Magisus/magical-cards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Magisus/magical-cards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Magisus/magical-cards/git/refs{/sha}","trees_url":"https://api.github.com/repos/Magisus/magical-cards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Magisus/magical-cards/statuses/{sha}","languages_url":"https://api.github.com/repos/Magisus/magical-cards/languages","stargazers_url":"https://api.github.com/repos/Magisus/magical-cards/stargazers","contributors_url":"https://api.github.com/repos/Magisus/magical-cards/contributors","subscribers_url":"https://api.github.com/repos/Magisus/magical-cards/subscribers","subscription_url":"https://api.github.com/repos/Magisus/magical-cards/subscription","commits_url":"https://api.github.com/repos/Magisus/magical-cards/commits{/sha}","git_commits_url":"https://api.github.com/repos/Magisus/magical-cards/git/commits{/sha}","comments_url":"https://api.github.com/repos/Magisus/magical-cards/comments{/number}","issue_comment_url":"https://api.github.com/repos/Magisus/magical-cards/issues/comments{/number}","contents_url":"https://api.github.com/repos/Magisus/magical-cards/contents/{+path}","compare_url":"https://api.github.com/repos/Magisus/magical-cards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Magisus/magical-cards/merges","archive_url":"https://api.github.com/repos/Magisus/magical-cards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Magisus/magical-cards/downloads","issues_url":"https://api.github.com/repos/Magisus/magical-cards/issues{/number}","pulls_url":"https://api.github.com/repos/Magisus/magical-cards/pulls{/number}","milestones_url":"https://api.github.com/repos/Magisus/magical-cards/milestones{/number}","notifications_url":"https://api.github.com/repos/Magisus/magical-cards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Magisus/magical-cards/labels{/name}","releases_url":"https://api.github.com/repos/Magisus/magical-cards/releases{/id}","deployments_url":"https://api.github.com/repos/Magisus/magical-cards/deployments","created_at":"2016-11-16T06:17:59Z","updated_at":"2016-11-16T06:18:00Z","pushed_at":"2016-12-05T20:49:41Z","git_url":"git://github.com/Magisus/magical-cards.git","ssh_url":"git@github.com:Magisus/magical-cards.git","clone_url":"https://github.com/Magisus/magical-cards.git","svn_url":"https://github.com/Magisus/magical-cards","homepage":null,"size":57,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"connorlay:master","ref":"master","sha":"4ceebee18bbae71df840e9908e89c2af5e62fe6c","user":{"login":"connorlay","id":6548350,"avatar_url":"https://avatars.githubusercontent.com/u/6548350?v=3","gravatar_id":"","url":"https://api.github.com/users/connorlay","html_url":"https://github.com/connorlay","followers_url":"https://api.github.com/users/connorlay/followers","following_url":"https://api.github.com/users/connorlay/following{/other_user}","gists_url":"https://api.github.com/users/connorlay/gists{/gist_id}","starred_url":"https://api.github.com/users/connorlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connorlay/subscriptions","organizations_url":"https://api.github.com/users/connorlay/orgs","repos_url":"https://api.github.com/users/connorlay/repos","events_url":"https://api.github.com/users/connorlay/events{/privacy}","received_events_url":"https://api.github.com/users/connorlay/received_events","type":"User","site_admin":false},"repo":{"id":73580261,"name":"magical-cards","full_name":"connorlay/magical-cards","owner":{"login":"connorlay","id":6548350,"avatar_url":"https://avatars.githubusercontent.com/u/6548350?v=3","gravatar_id":"","url":"https://api.github.com/users/connorlay","html_url":"https://github.com/connorlay","followers_url":"https://api.github.com/users/connorlay/followers","following_url":"https://api.github.com/users/connorlay/following{/other_user}","gists_url":"https://api.github.com/users/connorlay/gists{/gist_id}","starred_url":"https://api.github.com/users/connorlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connorlay/subscriptions","organizations_url":"https://api.github.com/users/connorlay/orgs","repos_url":"https://api.github.com/users/connorlay/repos","events_url":"https://api.github.com/users/connorlay/events{/privacy}","received_events_url":"https://api.github.com/users/connorlay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/connorlay/magical-cards","description":"A simple MTG client built with Elm and Electron.","fork":false,"url":"https://api.github.com/repos/connorlay/magical-cards","forks_url":"https://api.github.com/repos/connorlay/magical-cards/forks","keys_url":"https://api.github.com/repos/connorlay/magical-cards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/connorlay/magical-cards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/connorlay/magical-cards/teams","hooks_url":"https://api.github.com/repos/connorlay/magical-cards/hooks","issue_events_url":"https://api.github.com/repos/connorlay/magical-cards/issues/events{/number}","events_url":"https://api.github.com/repos/connorlay/magical-cards/events","assignees_url":"https://api.github.com/repos/connorlay/magical-cards/assignees{/user}","branches_url":"https://api.github.com/repos/connorlay/magical-cards/branches{/branch}","tags_url":"https://api.github.com/repos/connorlay/magical-cards/tags","blobs_url":"https://api.github.com/repos/connorlay/magical-cards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/connorlay/magical-cards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/connorlay/magical-cards/git/refs{/sha}","trees_url":"https://api.github.com/repos/connorlay/magical-cards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/connorlay/magical-cards/statuses/{sha}","languages_url":"https://api.github.com/repos/connorlay/magical-cards/languages","stargazers_url":"https://api.github.com/repos/connorlay/magical-cards/stargazers","contributors_url":"https://api.github.com/repos/connorlay/magical-cards/contributors","subscribers_url":"https://api.github.com/repos/connorlay/magical-cards/subscribers","subscription_url":"https://api.github.com/repos/connorlay/magical-cards/subscription","commits_url":"https://api.github.com/repos/connorlay/magical-cards/commits{/sha}","git_commits_url":"https://api.github.com/repos/connorlay/magical-cards/git/commits{/sha}","comments_url":"https://api.github.com/repos/connorlay/magical-cards/comments{/number}","issue_comment_url":"https://api.github.com/repos/connorlay/magical-cards/issues/comments{/number}","contents_url":"https://api.github.com/repos/connorlay/magical-cards/contents/{+path}","compare_url":"https://api.github.com/repos/connorlay/magical-cards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/connorlay/magical-cards/merges","archive_url":"https://api.github.com/repos/connorlay/magical-cards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/connorlay/magical-cards/downloads","issues_url":"https://api.github.com/repos/connorlay/magical-cards/issues{/number}","pulls_url":"https://api.github.com/repos/connorlay/magical-cards/pulls{/number}","milestones_url":"https://api.github.com/repos/connorlay/magical-cards/milestones{/number}","notifications_url":"https://api.github.com/repos/connorlay/magical-cards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/connorlay/magical-cards/labels{/name}","releases_url":"https://api.github.com/repos/connorlay/magical-cards/releases{/id}","deployments_url":"https://api.github.com/repos/connorlay/magical-cards/deployments","created_at":"2016-11-12T21:44:39Z","updated_at":"2016-12-03T21:42:08Z","pushed_at":"2016-12-05T20:49:42Z","git_url":"git://github.com/connorlay/magical-cards.git","ssh_url":"git@github.com:connorlay/magical-cards.git","clone_url":"https://github.com/connorlay/magical-cards.git","svn_url":"https://github.com/connorlay/magical-cards","homepage":null,"size":47,"stargazers_count":0,"watchers_count":0,"language":"Elm","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":10,"forks":1,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/connorlay/magical-cards/pulls/10"},"html":{"href":"https://github.com/connorlay/magical-cards/pull/10"},"issue":{"href":"https://api.github.com/repos/connorlay/magical-cards/issues/10"},"comments":{"href":"https://api.github.com/repos/connorlay/magical-cards/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/connorlay/magical-cards/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/connorlay/magical-cards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/connorlay/magical-cards/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/connorlay/magical-cards/statuses/a70388b5502e93f29ee51ca7dd8e3ff9e5d048fc"}}}}
{"actor":{"display_login":"connorlay"}}