{"action":"created","comment":{"url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/comments/174279688","pull_request_review_id":103607390,"id":174279688,"diff_hunk":"@@ -0,0 +1,290 @@\n+---\n+title: 測試替身(上篇)\n+date: 2018-03-02 07:12:25\n+tags: unitTest testDouble\n+author: jyt0532\n+---\n+\n+如果你在工作時寫過一些測試程式，也許你聽過什麼是 Mock，但其實 Mock 只是測試替身的其中一種，測試替身包含了 Dummy、Mock、Fake、Stub、Spy。而不同語言或不同framework有時候會把類似的概念合在一起。\n+\n+本系列的目的是讓你寫單元測試的時候，對應不同情況，知道應該用哪一種替身。像筆者常用的Mockito基本上把大部份的測試替身都用Mock取代，雖然用起來容易，但我以前從來不知道自己用的是哪一種測試替身 。","path":"source/_posts/test-double-1.md","position":null,"original_position":10,"commit_id":"c2f7d989602afb9a0b1fe255d16327284c4f67f3","original_commit_id":"689c24a37a7e88f21faf9fd83d63641ab014a34f","user":{"login":"jyt0532","id":2044832,"avatar_url":"https://avatars1.githubusercontent.com/u/2044832?v=4","gravatar_id":"","url":"https://api.github.com/users/jyt0532","html_url":"https://github.com/jyt0532","followers_url":"https://api.github.com/users/jyt0532/followers","following_url":"https://api.github.com/users/jyt0532/following{/other_user}","gists_url":"https://api.github.com/users/jyt0532/gists{/gist_id}","starred_url":"https://api.github.com/users/jyt0532/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyt0532/subscriptions","organizations_url":"https://api.github.com/users/jyt0532/orgs","repos_url":"https://api.github.com/users/jyt0532/repos","events_url":"https://api.github.com/users/jyt0532/events{/privacy}","received_events_url":"https://api.github.com/users/jyt0532/received_events","type":"User","site_admin":false},"body":"Fixed!","created_at":"2018-03-13T20:50:54Z","updated_at":"2018-03-13T20:50:54Z","html_url":"https://github.com/TechBridgeWeekly/blog-starter-kit/pull/13#discussion_r174279688","pull_request_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/13","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/comments/174279688"},"html":{"href":"https://github.com/TechBridgeWeekly/blog-starter-kit/pull/13#discussion_r174279688"},"pull_request":{"href":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/13"}},"in_reply_to_id":174093082},"pull_request":{"url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/13","id":172758275,"html_url":"https://github.com/TechBridgeWeekly/blog-starter-kit/pull/13","diff_url":"https://github.com/TechBridgeWeekly/blog-starter-kit/pull/13.diff","patch_url":"https://github.com/TechBridgeWeekly/blog-starter-kit/pull/13.patch","issue_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/issues/13","number":13,"state":"open","locked":false,"title":"Test double part1","user":{"login":"jyt0532","id":2044832,"avatar_url":"https://avatars1.githubusercontent.com/u/2044832?v=4","gravatar_id":"","url":"https://api.github.com/users/jyt0532","html_url":"https://github.com/jyt0532","followers_url":"https://api.github.com/users/jyt0532/followers","following_url":"https://api.github.com/users/jyt0532/following{/other_user}","gists_url":"https://api.github.com/users/jyt0532/gists{/gist_id}","starred_url":"https://api.github.com/users/jyt0532/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyt0532/subscriptions","organizations_url":"https://api.github.com/users/jyt0532/orgs","repos_url":"https://api.github.com/users/jyt0532/repos","events_url":"https://api.github.com/users/jyt0532/events{/privacy}","received_events_url":"https://api.github.com/users/jyt0532/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-05T02:02:30Z","updated_at":"2018-03-13T20:50:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07961b366d74a7f5efb77ecd3d329d9eefbcf76d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/13/commits","review_comments_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/13/comments","review_comment_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/issues/13/comments","statuses_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/statuses/c2f7d989602afb9a0b1fe255d16327284c4f67f3","head":{"label":"jyt0532:test_double1","ref":"test_double1","sha":"c2f7d989602afb9a0b1fe255d16327284c4f67f3","user":{"login":"jyt0532","id":2044832,"avatar_url":"https://avatars1.githubusercontent.com/u/2044832?v=4","gravatar_id":"","url":"https://api.github.com/users/jyt0532","html_url":"https://github.com/jyt0532","followers_url":"https://api.github.com/users/jyt0532/followers","following_url":"https://api.github.com/users/jyt0532/following{/other_user}","gists_url":"https://api.github.com/users/jyt0532/gists{/gist_id}","starred_url":"https://api.github.com/users/jyt0532/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyt0532/subscriptions","organizations_url":"https://api.github.com/users/jyt0532/orgs","repos_url":"https://api.github.com/users/jyt0532/repos","events_url":"https://api.github.com/users/jyt0532/events{/privacy}","received_events_url":"https://api.github.com/users/jyt0532/received_events","type":"User","site_admin":false},"repo":{"id":88389141,"name":"blog-starter-kit","full_name":"jyt0532/blog-starter-kit","owner":{"login":"jyt0532","id":2044832,"avatar_url":"https://avatars1.githubusercontent.com/u/2044832?v=4","gravatar_id":"","url":"https://api.github.com/users/jyt0532","html_url":"https://github.com/jyt0532","followers_url":"https://api.github.com/users/jyt0532/followers","following_url":"https://api.github.com/users/jyt0532/following{/other_user}","gists_url":"https://api.github.com/users/jyt0532/gists{/gist_id}","starred_url":"https://api.github.com/users/jyt0532/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyt0532/subscriptions","organizations_url":"https://api.github.com/users/jyt0532/orgs","repos_url":"https://api.github.com/users/jyt0532/repos","events_url":"https://api.github.com/users/jyt0532/events{/privacy}","received_events_url":"https://api.github.com/users/jyt0532/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jyt0532/blog-starter-kit","description":"This is TechBridge Tech's blog-starter-kit.","fork":true,"url":"https://api.github.com/repos/jyt0532/blog-starter-kit","forks_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/forks","keys_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/teams","hooks_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/hooks","issue_events_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/issues/events{/number}","events_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/events","assignees_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/assignees{/user}","branches_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/branches{/branch}","tags_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/tags","blobs_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/languages","stargazers_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/stargazers","contributors_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/contributors","subscribers_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/subscribers","subscription_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/subscription","commits_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/contents/{+path}","compare_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/merges","archive_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/downloads","issues_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/issues{/number}","pulls_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/labels{/name}","releases_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/releases{/id}","deployments_url":"https://api.github.com/repos/jyt0532/blog-starter-kit/deployments","created_at":"2017-04-16T03:41:38Z","updated_at":"2017-04-16T03:41:40Z","pushed_at":"2018-03-13T20:50:30Z","git_url":"git://github.com/jyt0532/blog-starter-kit.git","ssh_url":"git@github.com:jyt0532/blog-starter-kit.git","clone_url":"https://github.com/jyt0532/blog-starter-kit.git","svn_url":"https://github.com/jyt0532/blog-starter-kit","homepage":"http://blog.techbridge.cc","size":153261,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TechBridgeWeekly:master","ref":"master","sha":"04d8bd1e45abe11dd31cee96bc4eab48b1c5eaae","user":{"login":"TechBridgeWeekly","id":15801525,"avatar_url":"https://avatars3.githubusercontent.com/u/15801525?v=4","gravatar_id":"","url":"https://api.github.com/users/TechBridgeWeekly","html_url":"https://github.com/TechBridgeWeekly","followers_url":"https://api.github.com/users/TechBridgeWeekly/followers","following_url":"https://api.github.com/users/TechBridgeWeekly/following{/other_user}","gists_url":"https://api.github.com/users/TechBridgeWeekly/gists{/gist_id}","starred_url":"https://api.github.com/users/TechBridgeWeekly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechBridgeWeekly/subscriptions","organizations_url":"https://api.github.com/users/TechBridgeWeekly/orgs","repos_url":"https://api.github.com/users/TechBridgeWeekly/repos","events_url":"https://api.github.com/users/TechBridgeWeekly/events{/privacy}","received_events_url":"https://api.github.com/users/TechBridgeWeekly/received_events","type":"Organization","site_admin":false},"repo":{"id":54295481,"name":"blog-starter-kit","full_name":"TechBridgeWeekly/blog-starter-kit","owner":{"login":"TechBridgeWeekly","id":15801525,"avatar_url":"https://avatars3.githubusercontent.com/u/15801525?v=4","gravatar_id":"","url":"https://api.github.com/users/TechBridgeWeekly","html_url":"https://github.com/TechBridgeWeekly","followers_url":"https://api.github.com/users/TechBridgeWeekly/followers","following_url":"https://api.github.com/users/TechBridgeWeekly/following{/other_user}","gists_url":"https://api.github.com/users/TechBridgeWeekly/gists{/gist_id}","starred_url":"https://api.github.com/users/TechBridgeWeekly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechBridgeWeekly/subscriptions","organizations_url":"https://api.github.com/users/TechBridgeWeekly/orgs","repos_url":"https://api.github.com/users/TechBridgeWeekly/repos","events_url":"https://api.github.com/users/TechBridgeWeekly/events{/privacy}","received_events_url":"https://api.github.com/users/TechBridgeWeekly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TechBridgeWeekly/blog-starter-kit","description":"This is TechBridge Tech's blog-starter-kit.","fork":false,"url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit","forks_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/forks","keys_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/teams","hooks_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/hooks","issue_events_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/issues/events{/number}","events_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/events","assignees_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/assignees{/user}","branches_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/branches{/branch}","tags_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/tags","blobs_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/languages","stargazers_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/stargazers","contributors_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/contributors","subscribers_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/subscribers","subscription_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/subscription","commits_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/contents/{+path}","compare_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/merges","archive_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/downloads","issues_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/issues{/number}","pulls_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/labels{/name}","releases_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/releases{/id}","deployments_url":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/deployments","created_at":"2016-03-20T01:45:01Z","updated_at":"2018-03-13T11:17:08Z","pushed_at":"2018-03-13T20:50:31Z","git_url":"git://github.com/TechBridgeWeekly/blog-starter-kit.git","ssh_url":"git@github.com:TechBridgeWeekly/blog-starter-kit.git","clone_url":"https://github.com/TechBridgeWeekly/blog-starter-kit.git","svn_url":"https://github.com/TechBridgeWeekly/blog-starter-kit","homepage":"https://blog.techbridge.cc","size":161089,"stargazers_count":29,"watchers_count":29,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":9,"open_issues":4,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/13"},"html":{"href":"https://github.com/TechBridgeWeekly/blog-starter-kit/pull/13"},"issue":{"href":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/issues/13"},"comments":{"href":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/TechBridgeWeekly/blog-starter-kit/statuses/c2f7d989602afb9a0b1fe255d16327284c4f67f3"}},"author_association":"NONE"}}
{"actor":{"display_login":"jyt0532"}}