{"action":"created","issue":{"url":"https://api.github.com/repos/luyaosuperman/python3-playground/issues/1","repository_url":"https://api.github.com/repos/luyaosuperman/python3-playground","labels_url":"https://api.github.com/repos/luyaosuperman/python3-playground/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/luyaosuperman/python3-playground/issues/1/comments","events_url":"https://api.github.com/repos/luyaosuperman/python3-playground/issues/1/events","html_url":"https://github.com/luyaosuperman/python3-playground/pull/1","id":238548082,"number":1,"title":"Blackjack","user":{"login":"luyaosuperman","id":2969220,"avatar_url":"https://avatars0.githubusercontent.com/u/2969220?v=3","gravatar_id":"","url":"https://api.github.com/users/luyaosuperman","html_url":"https://github.com/luyaosuperman","followers_url":"https://api.github.com/users/luyaosuperman/followers","following_url":"https://api.github.com/users/luyaosuperman/following{/other_user}","gists_url":"https://api.github.com/users/luyaosuperman/gists{/gist_id}","starred_url":"https://api.github.com/users/luyaosuperman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luyaosuperman/subscriptions","organizations_url":"https://api.github.com/users/luyaosuperman/orgs","repos_url":"https://api.github.com/users/luyaosuperman/repos","events_url":"https://api.github.com/users/luyaosuperman/events{/privacy}","received_events_url":"https://api.github.com/users/luyaosuperman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-26T13:45:31Z","updated_at":"2017-07-10T10:54:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/luyaosuperman/python3-playground/pulls/1","html_url":"https://github.com/luyaosuperman/python3-playground/pull/1","diff_url":"https://github.com/luyaosuperman/python3-playground/pull/1.diff","patch_url":"https://github.com/luyaosuperman/python3-playground/pull/1.patch"},"body":"This is the package of blackjack.\r\nImplemented\r\n(1) one round of game only, for the moment\r\n(2) multiple decks.\r\n(3) multiple users\r\n(4) hit, stand, double, split, surrender\r\n\r\nLack of\r\n(1) Chips\r\n(2) Multiple rounds\r\n\r\nfiles:\r\n\r\n./__init__.py\r\n./card.py\r\n./dealer.py\r\n./game.py <--- \"Game\" class implements the logic\r\n./player.py\r\n./xprint.py\r\n\r\n./test.sh\r\n./tests/cardTest.py\r\n./tests/dealerTest.py\r\n./tests/gameTest.py\r\n./tests/__init__.py\r\n./tests/playerTest.py\r\n\r\n![umlattempt](https://user-images.githubusercontent.com/2969220/27565899-a09b6398-5b24-11e7-833b-207568c3fb00.PNG)\r\n![umlattempt1](https://user-images.githubusercontent.com/2969220/27565901-a22fb7ae-5b24-11e7-9867-b3bd87389e80.PNG)\r\n\r\n\r\n+++++\r\nMost of the time was spent on implementing test cases. I have put it into a package and utilizes the \"unittest discover\" to automate it a bit. I browsed some projects in Github to get some idea about test organziation.\r\n\r\nHowever\r\n(1) it is still very hard to test class \"Game\" in game.py as it is basically manipulating other classes without returning any value. I am not sure how to design the unittest for it. Or, how should I rewrite it to make it more test friendly.\r\n\r\n(2) I tried to seperate \"Player\" and \"Dealer\" as much as possible while I have to pass one of the func pointer \"Dealer.dealACard\" into Player, so that player can get a card from dealer. I am not very sure if I can do better in seperating two classes.\r\n\r\n(3) cursesTest.py was deleted locally and it won't apper in git fetch/pull. I am still looking into how to remove it from Github repo."},"comment":{"url":"https://api.github.com/repos/luyaosuperman/python3-playground/issues/comments/314072762","html_url":"https://github.com/luyaosuperman/python3-playground/pull/1#issuecomment-314072762","issue_url":"https://api.github.com/repos/luyaosuperman/python3-playground/issues/1","id":314072762,"user":{"login":"cjwfuller","id":1325209,"avatar_url":"https://avatars1.githubusercontent.com/u/1325209?v=3","gravatar_id":"","url":"https://api.github.com/users/cjwfuller","html_url":"https://github.com/cjwfuller","followers_url":"https://api.github.com/users/cjwfuller/followers","following_url":"https://api.github.com/users/cjwfuller/following{/other_user}","gists_url":"https://api.github.com/users/cjwfuller/gists{/gist_id}","starred_url":"https://api.github.com/users/cjwfuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjwfuller/subscriptions","organizations_url":"https://api.github.com/users/cjwfuller/orgs","repos_url":"https://api.github.com/users/cjwfuller/repos","events_url":"https://api.github.com/users/cjwfuller/events{/privacy}","received_events_url":"https://api.github.com/users/cjwfuller/received_events","type":"User","site_admin":false},"created_at":"2017-07-10T10:54:23Z","updated_at":"2017-07-10T10:54:23Z","body":"This looks good."}}
{"actor":{"display_login":"cjwfuller"}}