{"action":"created","comment":{"url":"https://api.github.com/repos/codurance/site/pulls/comments/83021273","pull_request_review_id":3886287,"id":83021273,"diff_hunk":"@@ -0,0 +1,103 @@\n+---\n+layout: post\n+asset-type: post\n+name: Approaching Outside-in TDD on Android III\n+title: 'Approaching Outside-in TDD on Android III'\n+author: Carlos Morera de la Chica\n+image:\n+    src: /assets/img/custom/blog/outside-in-3.jpg\n+tags: \n+- android\n+- tdd \n+- design\n+canonical:\n+    name: my personal blog\n+    href: https://carlosmchica.github.io/approaching-tdd-outside-android-iii/\n+\n+---\n+\n+<a href=\"/2016/09/29/approaching-tdd-outside-android-ii/\">In the previous post</a>, we wrote the acceptance test as a first step and started creating the most external classes of our implementation. In this post, we will finish implementing the system, and will summarize what we have learnt during the process.\n+\n+<h2>Inner loop continuation</h2>\n+To finish the <b>BankAccount</b> class, we need to implement its last public method, <b>showStatement</b>. Let's dive into the next iteration of the inner loop cycle.\n+\n+<ul style=\"display: inline-block; list-style: none; text-align: left;\">\n+<li><span style=\"color: #d32f2f; padding-right: 5px;\">●</span><a href=\"https://github.com/CarlosMChica/AndroidBankKata/commit/0a0af116beacac964c95552dcef5ae120d2ff817\">Red</a> - We created a StatementFormatter to format the statement lines. We considered the statement to be a domain concept important enough to have its own class. It acts as a first class collection around the statement lines that attracts behaviour related to the statement lines.\n+The failing test ensures that when we show an account statement, the view is called with the appropriate statement lines.</li>\n+\n+<li><span style=\"color: #388e3c; padding-right: 5px;\">●</span><a href=\"https://github.com/CarlosMChica/AndroidBankKata/commit/dd1a92aaf6b6480ac2dbfcdaf29188fdcb2b7611\">Green</a> - The implementation is quite simple in this case. The BankAccount just needs to create a new statement with the transactions from the repository, pass it to the formatter to format and show the formatted statement using the view.</li>\n+<li><span style=\"color: #1976d2; padding-right: 5px;\">●</span>Refactor - Nothing to refactor here.</li>\n+</ul>\n+\n+As a rule of thumb, once a class is done, the next step is to run the acceptance test to check the progress and to know what is the next collaborator to implement. \n+\n+If we executed the acceptance test at this point, we would see that the <b>TransactionRepository</b> throws an UnsupportedOperationException. As we stated before, throwing an exception in the methods that we have not implemented yet will guide us through the feature implementation and will point us to the next collaborator to implement. It is quite important, as doing so, we have greater control over the current feature progress. We just need to follow the exceptions until the feature is fully implemented.\n+\n+<ul style=\"display: inline-block; list-style: none; text-align: left;\">\n+<li><span style=\"color: #d32f2f; padding-right: 5px;\">●</span><a href=\"https://github.com/CarlosMChica/AndroidBankKata/commit/f1585c33ae99ed2daa3aec6a6b9b9e999e8e391e\">Red</a> - TransactionRepository is a leaf node in the tree of collaborators. Meaning that, it does not collaborate with other classes. Leaf nodes can not be tested using mocks as there is no collaboration, so we need to flip to the classicist style of TDD and test through state rather than through behaviour. TransactionRepository is going to be implemented as an in-memory storage, so we decided to test it by storing a transaction and checking that the list returned in the transactions method contains the previously stored transaction.</li>\n+<li><span style=\"color: #388e3c; padding-right: 5px;\">●</span><a href=\"https://github.com/CarlosMChica/AndroidBankKata/commit/6b0bf42d59285675f66130ed39851e0ffa11bfa7\">Green</a> - To make the test pass we just need to return the current list of transactions, as best practice we recommend to return an immutable list to protect it for clients that could try to modify it.</li>","path":"_posts/2016-10-11-approaching-tdd-outside-android-iii.md","position":38,"original_position":38,"commit_id":"a8030355ca57ea3873b6f34e7469341381ed2c81","original_commit_id":"a8030355ca57ea3873b6f34e7469341381ed2c81","user":{"login":"franziskas","id":5154737,"avatar_url":"https://avatars.githubusercontent.com/u/5154737?v=3","gravatar_id":"","url":"https://api.github.com/users/franziskas","html_url":"https://github.com/franziskas","followers_url":"https://api.github.com/users/franziskas/followers","following_url":"https://api.github.com/users/franziskas/following{/other_user}","gists_url":"https://api.github.com/users/franziskas/gists{/gist_id}","starred_url":"https://api.github.com/users/franziskas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franziskas/subscriptions","organizations_url":"https://api.github.com/users/franziskas/orgs","repos_url":"https://api.github.com/users/franziskas/repos","events_url":"https://api.github.com/users/franziskas/events{/privacy}","received_events_url":"https://api.github.com/users/franziskas/received_events","type":"User","site_admin":false},"body":"`To make the test pass, we just need to return the current list of transactions. As a best practice, we recommend to return an immutable list. This protects the result from being modified by clients.`","created_at":"2016-10-12T14:45:31Z","updated_at":"2016-10-12T14:45:31Z","html_url":"https://github.com/codurance/site/pull/423#discussion_r83021273","pull_request_url":"https://api.github.com/repos/codurance/site/pulls/423","_links":{"self":{"href":"https://api.github.com/repos/codurance/site/pulls/comments/83021273"},"html":{"href":"https://github.com/codurance/site/pull/423#discussion_r83021273"},"pull_request":{"href":"https://api.github.com/repos/codurance/site/pulls/423"}}},"pull_request":{"url":"https://api.github.com/repos/codurance/site/pulls/423","id":88872447,"html_url":"https://github.com/codurance/site/pull/423","diff_url":"https://github.com/codurance/site/pull/423.diff","patch_url":"https://github.com/codurance/site/pull/423.patch","issue_url":"https://api.github.com/repos/codurance/site/issues/423","number":423,"state":"open","locked":false,"title":"Add outside-in in android post part iii","user":{"login":"CarlosMChica","id":3494156,"avatar_url":"https://avatars.githubusercontent.com/u/3494156?v=3","gravatar_id":"","url":"https://api.github.com/users/CarlosMChica","html_url":"https://github.com/CarlosMChica","followers_url":"https://api.github.com/users/CarlosMChica/followers","following_url":"https://api.github.com/users/CarlosMChica/following{/other_user}","gists_url":"https://api.github.com/users/CarlosMChica/gists{/gist_id}","starred_url":"https://api.github.com/users/CarlosMChica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarlosMChica/subscriptions","organizations_url":"https://api.github.com/users/CarlosMChica/orgs","repos_url":"https://api.github.com/users/CarlosMChica/repos","events_url":"https://api.github.com/users/CarlosMChica/events{/privacy}","received_events_url":"https://api.github.com/users/CarlosMChica/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-10-11T17:09:00Z","updated_at":"2016-10-12T14:59:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0ae5165838cc4375e3627ff3880ae7e8146a90d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/codurance/site/pulls/423/commits","review_comments_url":"https://api.github.com/repos/codurance/site/pulls/423/comments","review_comment_url":"https://api.github.com/repos/codurance/site/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codurance/site/issues/423/comments","statuses_url":"https://api.github.com/repos/codurance/site/statuses/a8030355ca57ea3873b6f34e7469341381ed2c81","head":{"label":"codurance:outside_in_android_part_iii","ref":"outside_in_android_part_iii","sha":"a8030355ca57ea3873b6f34e7469341381ed2c81","user":{"login":"codurance","id":5751452,"avatar_url":"https://avatars.githubusercontent.com/u/5751452?v=3","gravatar_id":"","url":"https://api.github.com/users/codurance","html_url":"https://github.com/codurance","followers_url":"https://api.github.com/users/codurance/followers","following_url":"https://api.github.com/users/codurance/following{/other_user}","gists_url":"https://api.github.com/users/codurance/gists{/gist_id}","starred_url":"https://api.github.com/users/codurance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codurance/subscriptions","organizations_url":"https://api.github.com/users/codurance/orgs","repos_url":"https://api.github.com/users/codurance/repos","events_url":"https://api.github.com/users/codurance/events{/privacy}","received_events_url":"https://api.github.com/users/codurance/received_events","type":"Organization","site_admin":false},"repo":{"id":38424930,"name":"site","full_name":"codurance/site","owner":{"login":"codurance","id":5751452,"avatar_url":"https://avatars.githubusercontent.com/u/5751452?v=3","gravatar_id":"","url":"https://api.github.com/users/codurance","html_url":"https://github.com/codurance","followers_url":"https://api.github.com/users/codurance/followers","following_url":"https://api.github.com/users/codurance/following{/other_user}","gists_url":"https://api.github.com/users/codurance/gists{/gist_id}","starred_url":"https://api.github.com/users/codurance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codurance/subscriptions","organizations_url":"https://api.github.com/users/codurance/orgs","repos_url":"https://api.github.com/users/codurance/repos","events_url":"https://api.github.com/users/codurance/events{/privacy}","received_events_url":"https://api.github.com/users/codurance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codurance/site","description":"","fork":false,"url":"https://api.github.com/repos/codurance/site","forks_url":"https://api.github.com/repos/codurance/site/forks","keys_url":"https://api.github.com/repos/codurance/site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codurance/site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codurance/site/teams","hooks_url":"https://api.github.com/repos/codurance/site/hooks","issue_events_url":"https://api.github.com/repos/codurance/site/issues/events{/number}","events_url":"https://api.github.com/repos/codurance/site/events","assignees_url":"https://api.github.com/repos/codurance/site/assignees{/user}","branches_url":"https://api.github.com/repos/codurance/site/branches{/branch}","tags_url":"https://api.github.com/repos/codurance/site/tags","blobs_url":"https://api.github.com/repos/codurance/site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codurance/site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codurance/site/git/refs{/sha}","trees_url":"https://api.github.com/repos/codurance/site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codurance/site/statuses/{sha}","languages_url":"https://api.github.com/repos/codurance/site/languages","stargazers_url":"https://api.github.com/repos/codurance/site/stargazers","contributors_url":"https://api.github.com/repos/codurance/site/contributors","subscribers_url":"https://api.github.com/repos/codurance/site/subscribers","subscription_url":"https://api.github.com/repos/codurance/site/subscription","commits_url":"https://api.github.com/repos/codurance/site/commits{/sha}","git_commits_url":"https://api.github.com/repos/codurance/site/git/commits{/sha}","comments_url":"https://api.github.com/repos/codurance/site/comments{/number}","issue_comment_url":"https://api.github.com/repos/codurance/site/issues/comments{/number}","contents_url":"https://api.github.com/repos/codurance/site/contents/{+path}","compare_url":"https://api.github.com/repos/codurance/site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codurance/site/merges","archive_url":"https://api.github.com/repos/codurance/site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codurance/site/downloads","issues_url":"https://api.github.com/repos/codurance/site/issues{/number}","pulls_url":"https://api.github.com/repos/codurance/site/pulls{/number}","milestones_url":"https://api.github.com/repos/codurance/site/milestones{/number}","notifications_url":"https://api.github.com/repos/codurance/site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codurance/site/labels{/name}","releases_url":"https://api.github.com/repos/codurance/site/releases{/id}","deployments_url":"https://api.github.com/repos/codurance/site/deployments","created_at":"2015-07-02T09:54:02Z","updated_at":"2016-09-27T15:40:24Z","pushed_at":"2016-10-11T17:09:00Z","git_url":"git://github.com/codurance/site.git","ssh_url":"git@github.com:codurance/site.git","clone_url":"https://github.com/codurance/site.git","svn_url":"https://github.com/codurance/site","homepage":null,"size":177639,"stargazers_count":2,"watchers_count":2,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":8,"forks":8,"open_issues":8,"watchers":2,"default_branch":"master"}},"base":{"label":"codurance:master","ref":"master","sha":"55714fe354fff071a04de2a29371bc8ef43bedbe","user":{"login":"codurance","id":5751452,"avatar_url":"https://avatars.githubusercontent.com/u/5751452?v=3","gravatar_id":"","url":"https://api.github.com/users/codurance","html_url":"https://github.com/codurance","followers_url":"https://api.github.com/users/codurance/followers","following_url":"https://api.github.com/users/codurance/following{/other_user}","gists_url":"https://api.github.com/users/codurance/gists{/gist_id}","starred_url":"https://api.github.com/users/codurance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codurance/subscriptions","organizations_url":"https://api.github.com/users/codurance/orgs","repos_url":"https://api.github.com/users/codurance/repos","events_url":"https://api.github.com/users/codurance/events{/privacy}","received_events_url":"https://api.github.com/users/codurance/received_events","type":"Organization","site_admin":false},"repo":{"id":38424930,"name":"site","full_name":"codurance/site","owner":{"login":"codurance","id":5751452,"avatar_url":"https://avatars.githubusercontent.com/u/5751452?v=3","gravatar_id":"","url":"https://api.github.com/users/codurance","html_url":"https://github.com/codurance","followers_url":"https://api.github.com/users/codurance/followers","following_url":"https://api.github.com/users/codurance/following{/other_user}","gists_url":"https://api.github.com/users/codurance/gists{/gist_id}","starred_url":"https://api.github.com/users/codurance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codurance/subscriptions","organizations_url":"https://api.github.com/users/codurance/orgs","repos_url":"https://api.github.com/users/codurance/repos","events_url":"https://api.github.com/users/codurance/events{/privacy}","received_events_url":"https://api.github.com/users/codurance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codurance/site","description":"","fork":false,"url":"https://api.github.com/repos/codurance/site","forks_url":"https://api.github.com/repos/codurance/site/forks","keys_url":"https://api.github.com/repos/codurance/site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codurance/site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codurance/site/teams","hooks_url":"https://api.github.com/repos/codurance/site/hooks","issue_events_url":"https://api.github.com/repos/codurance/site/issues/events{/number}","events_url":"https://api.github.com/repos/codurance/site/events","assignees_url":"https://api.github.com/repos/codurance/site/assignees{/user}","branches_url":"https://api.github.com/repos/codurance/site/branches{/branch}","tags_url":"https://api.github.com/repos/codurance/site/tags","blobs_url":"https://api.github.com/repos/codurance/site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codurance/site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codurance/site/git/refs{/sha}","trees_url":"https://api.github.com/repos/codurance/site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codurance/site/statuses/{sha}","languages_url":"https://api.github.com/repos/codurance/site/languages","stargazers_url":"https://api.github.com/repos/codurance/site/stargazers","contributors_url":"https://api.github.com/repos/codurance/site/contributors","subscribers_url":"https://api.github.com/repos/codurance/site/subscribers","subscription_url":"https://api.github.com/repos/codurance/site/subscription","commits_url":"https://api.github.com/repos/codurance/site/commits{/sha}","git_commits_url":"https://api.github.com/repos/codurance/site/git/commits{/sha}","comments_url":"https://api.github.com/repos/codurance/site/comments{/number}","issue_comment_url":"https://api.github.com/repos/codurance/site/issues/comments{/number}","contents_url":"https://api.github.com/repos/codurance/site/contents/{+path}","compare_url":"https://api.github.com/repos/codurance/site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codurance/site/merges","archive_url":"https://api.github.com/repos/codurance/site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codurance/site/downloads","issues_url":"https://api.github.com/repos/codurance/site/issues{/number}","pulls_url":"https://api.github.com/repos/codurance/site/pulls{/number}","milestones_url":"https://api.github.com/repos/codurance/site/milestones{/number}","notifications_url":"https://api.github.com/repos/codurance/site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codurance/site/labels{/name}","releases_url":"https://api.github.com/repos/codurance/site/releases{/id}","deployments_url":"https://api.github.com/repos/codurance/site/deployments","created_at":"2015-07-02T09:54:02Z","updated_at":"2016-09-27T15:40:24Z","pushed_at":"2016-10-11T17:09:00Z","git_url":"git://github.com/codurance/site.git","ssh_url":"git@github.com:codurance/site.git","clone_url":"https://github.com/codurance/site.git","svn_url":"https://github.com/codurance/site","homepage":null,"size":177639,"stargazers_count":2,"watchers_count":2,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":8,"forks":8,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codurance/site/pulls/423"},"html":{"href":"https://github.com/codurance/site/pull/423"},"issue":{"href":"https://api.github.com/repos/codurance/site/issues/423"},"comments":{"href":"https://api.github.com/repos/codurance/site/issues/423/comments"},"review_comments":{"href":"https://api.github.com/repos/codurance/site/pulls/423/comments"},"review_comment":{"href":"https://api.github.com/repos/codurance/site/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codurance/site/pulls/423/commits"},"statuses":{"href":"https://api.github.com/repos/codurance/site/statuses/a8030355ca57ea3873b6f34e7469341381ed2c81"}}}}
{"actor":{"display_login":"franziskas"}}