{"action":"created","comment":{"url":"https://api.github.com/repos/Quick/Quick/pulls/comments/53529979","id":53529979,"diff_hunk":"@@ -0,0 +1,153 @@\n+# モックを使ったテスト\n+\n+## モックとは\n+\n+モックとはテスト対象のオブジェクト(クラス、構造体)が呼び出し先のオブジェクトと意図したとおりに協調動作するかどうかをテストするために使うオブジェクトのことです。\n+\n+## Swift でモックを使ったテストを書く\n+\n+### サンプルアプリケーション\t\n+\n+ここでは例として RSS reader のような記事の一覧を UITableView　で表示アプリケーションを考えます。\n+\n+* Article という構造体(struct)を ArticleViewController の UITableView で表示する\n+* データ(Article)の取得や保持、UITableViewDataSource の処理は ArticleProviderProtocol を実装したクラスが行う\n+\n+ここで ArticleProviderProtocol を定義します。\n+\n+```swift\n+// Swift\n+protocol ArticleProviderProtocol: UITableViewDataSource {\n+    var articles: [Article] { get }\n+    weak var tableView: UITableView! { get set }\n+    func setup()\n+    func fetch()\n+}\n+```","path":"Documentation/ja/TestUsingMock.md","position":26,"original_position":26,"commit_id":"0b3920e6b9474dbbc105d48f157185e9ef262691","original_commit_id":"0b3920e6b9474dbbc105d48f157185e9ef262691","user":{"login":"modocache","id":552921,"avatar_url":"https://avatars.githubusercontent.com/u/552921?v=3","gravatar_id":"","url":"https://api.github.com/users/modocache","html_url":"https://github.com/modocache","followers_url":"https://api.github.com/users/modocache/followers","following_url":"https://api.github.com/users/modocache/following{/other_user}","gists_url":"https://api.github.com/users/modocache/gists{/gist_id}","starred_url":"https://api.github.com/users/modocache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modocache/subscriptions","organizations_url":"https://api.github.com/users/modocache/orgs","repos_url":"https://api.github.com/users/modocache/repos","events_url":"https://api.github.com/users/modocache/events{/privacy}","received_events_url":"https://api.github.com/users/modocache/received_events","type":"User","site_admin":false},"body":"Would it be possible to demonstrate a problem that can be solved with mocks *without* using UIKit? I'm concerned about readers who may not be 100% familiar with UIKit and `UITableViewDataSource`. Just wondering whether that would make this easier to read--thoughts? :raised_hands: ","created_at":"2016-02-19T22:48:21Z","updated_at":"2016-02-19T22:48:21Z","html_url":"https://github.com/Quick/Quick/pull/487#discussion_r53529979","pull_request_url":"https://api.github.com/repos/Quick/Quick/pulls/487","_links":{"self":{"href":"https://api.github.com/repos/Quick/Quick/pulls/comments/53529979"},"html":{"href":"https://github.com/Quick/Quick/pull/487#discussion_r53529979"},"pull_request":{"href":"https://api.github.com/repos/Quick/Quick/pulls/487"}}},"pull_request":{"url":"https://api.github.com/repos/Quick/Quick/pulls/487","id":59605401,"html_url":"https://github.com/Quick/Quick/pull/487","diff_url":"https://github.com/Quick/Quick/pull/487.diff","patch_url":"https://github.com/Quick/Quick/pull/487.patch","issue_url":"https://api.github.com/repos/Quick/Quick/issues/487","number":487,"state":"open","locked":false,"title":"Add a document about mock","user":{"login":"takecian","id":836893,"avatar_url":"https://avatars.githubusercontent.com/u/836893?v=3","gravatar_id":"","url":"https://api.github.com/users/takecian","html_url":"https://github.com/takecian","followers_url":"https://api.github.com/users/takecian/followers","following_url":"https://api.github.com/users/takecian/following{/other_user}","gists_url":"https://api.github.com/users/takecian/gists{/gist_id}","starred_url":"https://api.github.com/users/takecian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takecian/subscriptions","organizations_url":"https://api.github.com/users/takecian/orgs","repos_url":"https://api.github.com/users/takecian/repos","events_url":"https://api.github.com/users/takecian/events{/privacy}","received_events_url":"https://api.github.com/users/takecian/received_events","type":"User","site_admin":false},"body":"I wrote a document about mock(#485), as of now, Japanese edition only.\r\nPlease review.\r\n\r\nThanks!","created_at":"2016-02-17T07:21:44Z","updated_at":"2016-02-19T22:48:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb78bee5b1bf28f7136c67efd55eaad7b042b64c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Quick/Quick/pulls/487/commits","review_comments_url":"https://api.github.com/repos/Quick/Quick/pulls/487/comments","review_comment_url":"https://api.github.com/repos/Quick/Quick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Quick/Quick/issues/487/comments","statuses_url":"https://api.github.com/repos/Quick/Quick/statuses/0b3920e6b9474dbbc105d48f157185e9ef262691","head":{"label":"takecian:master","ref":"master","sha":"0b3920e6b9474dbbc105d48f157185e9ef262691","user":{"login":"takecian","id":836893,"avatar_url":"https://avatars.githubusercontent.com/u/836893?v=3","gravatar_id":"","url":"https://api.github.com/users/takecian","html_url":"https://github.com/takecian","followers_url":"https://api.github.com/users/takecian/followers","following_url":"https://api.github.com/users/takecian/following{/other_user}","gists_url":"https://api.github.com/users/takecian/gists{/gist_id}","starred_url":"https://api.github.com/users/takecian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takecian/subscriptions","organizations_url":"https://api.github.com/users/takecian/orgs","repos_url":"https://api.github.com/users/takecian/repos","events_url":"https://api.github.com/users/takecian/events{/privacy}","received_events_url":"https://api.github.com/users/takecian/received_events","type":"User","site_admin":false},"repo":{"id":51370999,"name":"Quick","full_name":"takecian/Quick","owner":{"login":"takecian","id":836893,"avatar_url":"https://avatars.githubusercontent.com/u/836893?v=3","gravatar_id":"","url":"https://api.github.com/users/takecian","html_url":"https://github.com/takecian","followers_url":"https://api.github.com/users/takecian/followers","following_url":"https://api.github.com/users/takecian/following{/other_user}","gists_url":"https://api.github.com/users/takecian/gists{/gist_id}","starred_url":"https://api.github.com/users/takecian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takecian/subscriptions","organizations_url":"https://api.github.com/users/takecian/orgs","repos_url":"https://api.github.com/users/takecian/repos","events_url":"https://api.github.com/users/takecian/events{/privacy}","received_events_url":"https://api.github.com/users/takecian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/takecian/Quick","description":"The Swift (and Objective-C) testing framework.","fork":true,"url":"https://api.github.com/repos/takecian/Quick","forks_url":"https://api.github.com/repos/takecian/Quick/forks","keys_url":"https://api.github.com/repos/takecian/Quick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/takecian/Quick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/takecian/Quick/teams","hooks_url":"https://api.github.com/repos/takecian/Quick/hooks","issue_events_url":"https://api.github.com/repos/takecian/Quick/issues/events{/number}","events_url":"https://api.github.com/repos/takecian/Quick/events","assignees_url":"https://api.github.com/repos/takecian/Quick/assignees{/user}","branches_url":"https://api.github.com/repos/takecian/Quick/branches{/branch}","tags_url":"https://api.github.com/repos/takecian/Quick/tags","blobs_url":"https://api.github.com/repos/takecian/Quick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/takecian/Quick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/takecian/Quick/git/refs{/sha}","trees_url":"https://api.github.com/repos/takecian/Quick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/takecian/Quick/statuses/{sha}","languages_url":"https://api.github.com/repos/takecian/Quick/languages","stargazers_url":"https://api.github.com/repos/takecian/Quick/stargazers","contributors_url":"https://api.github.com/repos/takecian/Quick/contributors","subscribers_url":"https://api.github.com/repos/takecian/Quick/subscribers","subscription_url":"https://api.github.com/repos/takecian/Quick/subscription","commits_url":"https://api.github.com/repos/takecian/Quick/commits{/sha}","git_commits_url":"https://api.github.com/repos/takecian/Quick/git/commits{/sha}","comments_url":"https://api.github.com/repos/takecian/Quick/comments{/number}","issue_comment_url":"https://api.github.com/repos/takecian/Quick/issues/comments{/number}","contents_url":"https://api.github.com/repos/takecian/Quick/contents/{+path}","compare_url":"https://api.github.com/repos/takecian/Quick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/takecian/Quick/merges","archive_url":"https://api.github.com/repos/takecian/Quick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/takecian/Quick/downloads","issues_url":"https://api.github.com/repos/takecian/Quick/issues{/number}","pulls_url":"https://api.github.com/repos/takecian/Quick/pulls{/number}","milestones_url":"https://api.github.com/repos/takecian/Quick/milestones{/number}","notifications_url":"https://api.github.com/repos/takecian/Quick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/takecian/Quick/labels{/name}","releases_url":"https://api.github.com/repos/takecian/Quick/releases{/id}","deployments_url":"https://api.github.com/repos/takecian/Quick/deployments","created_at":"2016-02-09T14:13:05Z","updated_at":"2016-02-09T14:13:06Z","pushed_at":"2016-02-19T12:47:26Z","git_url":"git://github.com/takecian/Quick.git","ssh_url":"git@github.com:takecian/Quick.git","clone_url":"https://github.com/takecian/Quick.git","svn_url":"https://github.com/takecian/Quick","homepage":"","size":1617,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"Quick:master","ref":"master","sha":"bc67084995ba3c27a52cf19036f9585f09cc48f1","user":{"login":"Quick","id":8083968,"avatar_url":"https://avatars.githubusercontent.com/u/8083968?v=3","gravatar_id":"","url":"https://api.github.com/users/Quick","html_url":"https://github.com/Quick","followers_url":"https://api.github.com/users/Quick/followers","following_url":"https://api.github.com/users/Quick/following{/other_user}","gists_url":"https://api.github.com/users/Quick/gists{/gist_id}","starred_url":"https://api.github.com/users/Quick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Quick/subscriptions","organizations_url":"https://api.github.com/users/Quick/orgs","repos_url":"https://api.github.com/users/Quick/repos","events_url":"https://api.github.com/users/Quick/events{/privacy}","received_events_url":"https://api.github.com/users/Quick/received_events","type":"Organization","site_admin":false},"repo":{"id":20506004,"name":"Quick","full_name":"Quick/Quick","owner":{"login":"Quick","id":8083968,"avatar_url":"https://avatars.githubusercontent.com/u/8083968?v=3","gravatar_id":"","url":"https://api.github.com/users/Quick","html_url":"https://github.com/Quick","followers_url":"https://api.github.com/users/Quick/followers","following_url":"https://api.github.com/users/Quick/following{/other_user}","gists_url":"https://api.github.com/users/Quick/gists{/gist_id}","starred_url":"https://api.github.com/users/Quick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Quick/subscriptions","organizations_url":"https://api.github.com/users/Quick/orgs","repos_url":"https://api.github.com/users/Quick/repos","events_url":"https://api.github.com/users/Quick/events{/privacy}","received_events_url":"https://api.github.com/users/Quick/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Quick/Quick","description":"The Swift (and Objective-C) testing framework.","fork":false,"url":"https://api.github.com/repos/Quick/Quick","forks_url":"https://api.github.com/repos/Quick/Quick/forks","keys_url":"https://api.github.com/repos/Quick/Quick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Quick/Quick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Quick/Quick/teams","hooks_url":"https://api.github.com/repos/Quick/Quick/hooks","issue_events_url":"https://api.github.com/repos/Quick/Quick/issues/events{/number}","events_url":"https://api.github.com/repos/Quick/Quick/events","assignees_url":"https://api.github.com/repos/Quick/Quick/assignees{/user}","branches_url":"https://api.github.com/repos/Quick/Quick/branches{/branch}","tags_url":"https://api.github.com/repos/Quick/Quick/tags","blobs_url":"https://api.github.com/repos/Quick/Quick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Quick/Quick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Quick/Quick/git/refs{/sha}","trees_url":"https://api.github.com/repos/Quick/Quick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Quick/Quick/statuses/{sha}","languages_url":"https://api.github.com/repos/Quick/Quick/languages","stargazers_url":"https://api.github.com/repos/Quick/Quick/stargazers","contributors_url":"https://api.github.com/repos/Quick/Quick/contributors","subscribers_url":"https://api.github.com/repos/Quick/Quick/subscribers","subscription_url":"https://api.github.com/repos/Quick/Quick/subscription","commits_url":"https://api.github.com/repos/Quick/Quick/commits{/sha}","git_commits_url":"https://api.github.com/repos/Quick/Quick/git/commits{/sha}","comments_url":"https://api.github.com/repos/Quick/Quick/comments{/number}","issue_comment_url":"https://api.github.com/repos/Quick/Quick/issues/comments{/number}","contents_url":"https://api.github.com/repos/Quick/Quick/contents/{+path}","compare_url":"https://api.github.com/repos/Quick/Quick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Quick/Quick/merges","archive_url":"https://api.github.com/repos/Quick/Quick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Quick/Quick/downloads","issues_url":"https://api.github.com/repos/Quick/Quick/issues{/number}","pulls_url":"https://api.github.com/repos/Quick/Quick/pulls{/number}","milestones_url":"https://api.github.com/repos/Quick/Quick/milestones{/number}","notifications_url":"https://api.github.com/repos/Quick/Quick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Quick/Quick/labels{/name}","releases_url":"https://api.github.com/repos/Quick/Quick/releases{/id}","deployments_url":"https://api.github.com/repos/Quick/Quick/deployments","created_at":"2014-06-05T00:29:53Z","updated_at":"2016-02-19T12:39:12Z","pushed_at":"2016-02-19T22:30:27Z","git_url":"git://github.com/Quick/Quick.git","ssh_url":"git@github.com:Quick/Quick.git","clone_url":"https://github.com/Quick/Quick.git","svn_url":"https://github.com/Quick/Quick","homepage":"","size":2348,"stargazers_count":4176,"watchers_count":4176,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":390,"mirror_url":null,"open_issues_count":58,"forks":390,"open_issues":58,"watchers":4176,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Quick/Quick/pulls/487"},"html":{"href":"https://github.com/Quick/Quick/pull/487"},"issue":{"href":"https://api.github.com/repos/Quick/Quick/issues/487"},"comments":{"href":"https://api.github.com/repos/Quick/Quick/issues/487/comments"},"review_comments":{"href":"https://api.github.com/repos/Quick/Quick/pulls/487/comments"},"review_comment":{"href":"https://api.github.com/repos/Quick/Quick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Quick/Quick/pulls/487/commits"},"statuses":{"href":"https://api.github.com/repos/Quick/Quick/statuses/0b3920e6b9474dbbc105d48f157185e9ef262691"}}}}