{"action":"created","comment":{"url":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/comments/38270015","id":38270015,"diff_hunk":"@@ -0,0 +1,58 @@\n+﻿using System;\n+using NSubstitute.Acceptance.Specs.Infrastructure;\n+using NSubstitute.Extensions;\n+using NUnit.Framework;\n+\n+namespace NSubstitute.Acceptance.Specs\n+{\n+    [TestFixture]\n+    public class ReturnsForAll\n+    {\n+        private IFluentSomething _fluentSomething;\n+        private ISomething _something;\n+\n+        [SetUp]\n+        public void SetUp()\n+        {\n+            _fluentSomething = Substitute.For<IFluentSomething>();\n+            _something = Substitute.For<ISomething>();\n+            _fluentSomething.ReturnsForAll<IFluentSomething>(_fluentSomething);\n+            _fluentSomething.ReturnsForAll<ISomething>(_something);\n+        }\n+\n+        [Test]\n+        public void Return_self_for_single_call()\n+        {\n+            Assert.That(_fluentSomething.Chain(), Is.SameAs(_fluentSomething));\n+        }\n+\n+        [Test]\n+        public void Return_self_for_chained_calls()\n+        {\n+           Assert.That(_fluentSomething.Chain().Me().Together(), Is.SameAs(_fluentSomething));\n+        }\n+\n+        [Test]\n+        public void Return_value_that_is_not_chainable()\n+        {\n+            Assert.That(_fluentSomething.SorryNoChainingHere(), Is.SameAs(_something));\n+        }\n+\n+        [Test]\n+        public void Return_samce_thing_for_multiple_calls()\n+        {\n+            var _first = _fluentSomething.SorryNoChainingHere();","path":"Source/NSubstitute.Acceptance.Specs/ReturnsForAll.cs","position":44,"original_position":44,"commit_id":"2dac4f0ffa64aa39446c1009ff51b1b00188e9ae","original_commit_id":"2dac4f0ffa64aa39446c1009ff51b1b00188e9ae","user":{"login":"alexandrnikitin","id":1798438,"avatar_url":"https://avatars.githubusercontent.com/u/1798438?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandrnikitin","html_url":"https://github.com/alexandrnikitin","followers_url":"https://api.github.com/users/alexandrnikitin/followers","following_url":"https://api.github.com/users/alexandrnikitin/following{/other_user}","gists_url":"https://api.github.com/users/alexandrnikitin/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrnikitin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrnikitin/subscriptions","organizations_url":"https://api.github.com/users/alexandrnikitin/orgs","repos_url":"https://api.github.com/users/alexandrnikitin/repos","events_url":"https://api.github.com/users/alexandrnikitin/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrnikitin/received_events","type":"User","site_admin":false},"body":"The same in `FromFunc` tests","created_at":"2015-08-30T09:26:13Z","updated_at":"2015-08-30T09:26:13Z","html_url":"https://github.com/nsubstitute/NSubstitute/pull/198#discussion_r38270015","pull_request_url":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/198","_links":{"self":{"href":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/comments/38270015"},"html":{"href":"https://github.com/nsubstitute/NSubstitute/pull/198#discussion_r38270015"},"pull_request":{"href":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/198"}}},"pull_request":{"url":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/198","id":43700504,"html_url":"https://github.com/nsubstitute/NSubstitute/pull/198","diff_url":"https://github.com/nsubstitute/NSubstitute/pull/198.diff","patch_url":"https://github.com/nsubstitute/NSubstitute/pull/198.patch","issue_url":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/198","number":198,"state":"open","locked":false,"title":"Proposal for #196 ReturnsForAll<T>","user":{"login":"testpossessed","id":10528120,"avatar_url":"https://avatars.githubusercontent.com/u/10528120?v=3","gravatar_id":"","url":"https://api.github.com/users/testpossessed","html_url":"https://github.com/testpossessed","followers_url":"https://api.github.com/users/testpossessed/followers","following_url":"https://api.github.com/users/testpossessed/following{/other_user}","gists_url":"https://api.github.com/users/testpossessed/gists{/gist_id}","starred_url":"https://api.github.com/users/testpossessed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testpossessed/subscriptions","organizations_url":"https://api.github.com/users/testpossessed/orgs","repos_url":"https://api.github.com/users/testpossessed/repos","events_url":"https://api.github.com/users/testpossessed/events{/privacy}","received_events_url":"https://api.github.com/users/testpossessed/received_events","type":"User","site_admin":false},"body":"Following suggestion from David I have implemented two new extension methods that support configuring a substitute with a default return value for any method that returns a specified type.\r\n\r\nAs with most of the extension methods there are two variants one that accepts the actual value to return the other that accepts a Func to calculate the return value at call time.","created_at":"2015-08-29T19:33:54Z","updated_at":"2015-08-30T09:26:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5242a5be6c8076041636d59cd5b7563211983ac5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/198/commits","review_comments_url":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/198/comments","review_comment_url":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/198/comments","statuses_url":"https://api.github.com/repos/nsubstitute/NSubstitute/statuses/2dac4f0ffa64aa39446c1009ff51b1b00188e9ae","head":{"label":"testpossessed:master","ref":"master","sha":"2dac4f0ffa64aa39446c1009ff51b1b00188e9ae","user":{"login":"testpossessed","id":10528120,"avatar_url":"https://avatars.githubusercontent.com/u/10528120?v=3","gravatar_id":"","url":"https://api.github.com/users/testpossessed","html_url":"https://github.com/testpossessed","followers_url":"https://api.github.com/users/testpossessed/followers","following_url":"https://api.github.com/users/testpossessed/following{/other_user}","gists_url":"https://api.github.com/users/testpossessed/gists{/gist_id}","starred_url":"https://api.github.com/users/testpossessed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testpossessed/subscriptions","organizations_url":"https://api.github.com/users/testpossessed/orgs","repos_url":"https://api.github.com/users/testpossessed/repos","events_url":"https://api.github.com/users/testpossessed/events{/privacy}","received_events_url":"https://api.github.com/users/testpossessed/received_events","type":"User","site_admin":false},"repo":{"id":41077427,"name":"NSubstitute","full_name":"testpossessed/NSubstitute","owner":{"login":"testpossessed","id":10528120,"avatar_url":"https://avatars.githubusercontent.com/u/10528120?v=3","gravatar_id":"","url":"https://api.github.com/users/testpossessed","html_url":"https://github.com/testpossessed","followers_url":"https://api.github.com/users/testpossessed/followers","following_url":"https://api.github.com/users/testpossessed/following{/other_user}","gists_url":"https://api.github.com/users/testpossessed/gists{/gist_id}","starred_url":"https://api.github.com/users/testpossessed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testpossessed/subscriptions","organizations_url":"https://api.github.com/users/testpossessed/orgs","repos_url":"https://api.github.com/users/testpossessed/repos","events_url":"https://api.github.com/users/testpossessed/events{/privacy}","received_events_url":"https://api.github.com/users/testpossessed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/testpossessed/NSubstitute","description":"A friendly substitute for .NET mocking frameworks.","fork":true,"url":"https://api.github.com/repos/testpossessed/NSubstitute","forks_url":"https://api.github.com/repos/testpossessed/NSubstitute/forks","keys_url":"https://api.github.com/repos/testpossessed/NSubstitute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/testpossessed/NSubstitute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/testpossessed/NSubstitute/teams","hooks_url":"https://api.github.com/repos/testpossessed/NSubstitute/hooks","issue_events_url":"https://api.github.com/repos/testpossessed/NSubstitute/issues/events{/number}","events_url":"https://api.github.com/repos/testpossessed/NSubstitute/events","assignees_url":"https://api.github.com/repos/testpossessed/NSubstitute/assignees{/user}","branches_url":"https://api.github.com/repos/testpossessed/NSubstitute/branches{/branch}","tags_url":"https://api.github.com/repos/testpossessed/NSubstitute/tags","blobs_url":"https://api.github.com/repos/testpossessed/NSubstitute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/testpossessed/NSubstitute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/testpossessed/NSubstitute/git/refs{/sha}","trees_url":"https://api.github.com/repos/testpossessed/NSubstitute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/testpossessed/NSubstitute/statuses/{sha}","languages_url":"https://api.github.com/repos/testpossessed/NSubstitute/languages","stargazers_url":"https://api.github.com/repos/testpossessed/NSubstitute/stargazers","contributors_url":"https://api.github.com/repos/testpossessed/NSubstitute/contributors","subscribers_url":"https://api.github.com/repos/testpossessed/NSubstitute/subscribers","subscription_url":"https://api.github.com/repos/testpossessed/NSubstitute/subscription","commits_url":"https://api.github.com/repos/testpossessed/NSubstitute/commits{/sha}","git_commits_url":"https://api.github.com/repos/testpossessed/NSubstitute/git/commits{/sha}","comments_url":"https://api.github.com/repos/testpossessed/NSubstitute/comments{/number}","issue_comment_url":"https://api.github.com/repos/testpossessed/NSubstitute/issues/comments{/number}","contents_url":"https://api.github.com/repos/testpossessed/NSubstitute/contents/{+path}","compare_url":"https://api.github.com/repos/testpossessed/NSubstitute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/testpossessed/NSubstitute/merges","archive_url":"https://api.github.com/repos/testpossessed/NSubstitute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/testpossessed/NSubstitute/downloads","issues_url":"https://api.github.com/repos/testpossessed/NSubstitute/issues{/number}","pulls_url":"https://api.github.com/repos/testpossessed/NSubstitute/pulls{/number}","milestones_url":"https://api.github.com/repos/testpossessed/NSubstitute/milestones{/number}","notifications_url":"https://api.github.com/repos/testpossessed/NSubstitute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/testpossessed/NSubstitute/labels{/name}","releases_url":"https://api.github.com/repos/testpossessed/NSubstitute/releases{/id}","created_at":"2015-08-20T05:33:49Z","updated_at":"2015-08-20T05:33:51Z","pushed_at":"2015-08-29T19:26:29Z","git_url":"git://github.com/testpossessed/NSubstitute.git","ssh_url":"git@github.com:testpossessed/NSubstitute.git","clone_url":"https://github.com/testpossessed/NSubstitute.git","svn_url":"https://github.com/testpossessed/NSubstitute","homepage":"http://nsubstitute.github.com","size":63141,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"nsubstitute:master","ref":"master","sha":"8239b259694abe4df433893e4c4c9fac44feb27b","user":{"login":"nsubstitute","id":143513,"avatar_url":"https://avatars.githubusercontent.com/u/143513?v=3","gravatar_id":"","url":"https://api.github.com/users/nsubstitute","html_url":"https://github.com/nsubstitute","followers_url":"https://api.github.com/users/nsubstitute/followers","following_url":"https://api.github.com/users/nsubstitute/following{/other_user}","gists_url":"https://api.github.com/users/nsubstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/nsubstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsubstitute/subscriptions","organizations_url":"https://api.github.com/users/nsubstitute/orgs","repos_url":"https://api.github.com/users/nsubstitute/repos","events_url":"https://api.github.com/users/nsubstitute/events{/privacy}","received_events_url":"https://api.github.com/users/nsubstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":346893,"name":"NSubstitute","full_name":"nsubstitute/NSubstitute","owner":{"login":"nsubstitute","id":143513,"avatar_url":"https://avatars.githubusercontent.com/u/143513?v=3","gravatar_id":"","url":"https://api.github.com/users/nsubstitute","html_url":"https://github.com/nsubstitute","followers_url":"https://api.github.com/users/nsubstitute/followers","following_url":"https://api.github.com/users/nsubstitute/following{/other_user}","gists_url":"https://api.github.com/users/nsubstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/nsubstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsubstitute/subscriptions","organizations_url":"https://api.github.com/users/nsubstitute/orgs","repos_url":"https://api.github.com/users/nsubstitute/repos","events_url":"https://api.github.com/users/nsubstitute/events{/privacy}","received_events_url":"https://api.github.com/users/nsubstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nsubstitute/NSubstitute","description":"A friendly substitute for .NET mocking frameworks.","fork":false,"url":"https://api.github.com/repos/nsubstitute/NSubstitute","forks_url":"https://api.github.com/repos/nsubstitute/NSubstitute/forks","keys_url":"https://api.github.com/repos/nsubstitute/NSubstitute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nsubstitute/NSubstitute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nsubstitute/NSubstitute/teams","hooks_url":"https://api.github.com/repos/nsubstitute/NSubstitute/hooks","issue_events_url":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/events{/number}","events_url":"https://api.github.com/repos/nsubstitute/NSubstitute/events","assignees_url":"https://api.github.com/repos/nsubstitute/NSubstitute/assignees{/user}","branches_url":"https://api.github.com/repos/nsubstitute/NSubstitute/branches{/branch}","tags_url":"https://api.github.com/repos/nsubstitute/NSubstitute/tags","blobs_url":"https://api.github.com/repos/nsubstitute/NSubstitute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nsubstitute/NSubstitute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nsubstitute/NSubstitute/git/refs{/sha}","trees_url":"https://api.github.com/repos/nsubstitute/NSubstitute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nsubstitute/NSubstitute/statuses/{sha}","languages_url":"https://api.github.com/repos/nsubstitute/NSubstitute/languages","stargazers_url":"https://api.github.com/repos/nsubstitute/NSubstitute/stargazers","contributors_url":"https://api.github.com/repos/nsubstitute/NSubstitute/contributors","subscribers_url":"https://api.github.com/repos/nsubstitute/NSubstitute/subscribers","subscription_url":"https://api.github.com/repos/nsubstitute/NSubstitute/subscription","commits_url":"https://api.github.com/repos/nsubstitute/NSubstitute/commits{/sha}","git_commits_url":"https://api.github.com/repos/nsubstitute/NSubstitute/git/commits{/sha}","comments_url":"https://api.github.com/repos/nsubstitute/NSubstitute/comments{/number}","issue_comment_url":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/comments{/number}","contents_url":"https://api.github.com/repos/nsubstitute/NSubstitute/contents/{+path}","compare_url":"https://api.github.com/repos/nsubstitute/NSubstitute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nsubstitute/NSubstitute/merges","archive_url":"https://api.github.com/repos/nsubstitute/NSubstitute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nsubstitute/NSubstitute/downloads","issues_url":"https://api.github.com/repos/nsubstitute/NSubstitute/issues{/number}","pulls_url":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls{/number}","milestones_url":"https://api.github.com/repos/nsubstitute/NSubstitute/milestones{/number}","notifications_url":"https://api.github.com/repos/nsubstitute/NSubstitute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nsubstitute/NSubstitute/labels{/name}","releases_url":"https://api.github.com/repos/nsubstitute/NSubstitute/releases{/id}","created_at":"2009-10-23T05:30:01Z","updated_at":"2015-08-27T18:24:46Z","pushed_at":"2015-08-29T19:33:55Z","git_url":"git://github.com/nsubstitute/NSubstitute.git","ssh_url":"git@github.com:nsubstitute/NSubstitute.git","clone_url":"https://github.com/nsubstitute/NSubstitute.git","svn_url":"https://github.com/nsubstitute/NSubstitute","homepage":"http://nsubstitute.github.com","size":65652,"stargazers_count":484,"watchers_count":484,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"open_issues_count":52,"forks":114,"open_issues":52,"watchers":484,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/198"},"html":{"href":"https://github.com/nsubstitute/NSubstitute/pull/198"},"issue":{"href":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/198"},"comments":{"href":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/198/comments"},"review_comments":{"href":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/198/comments"},"review_comment":{"href":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nsubstitute/NSubstitute/pulls/198/commits"},"statuses":{"href":"https://api.github.com/repos/nsubstitute/NSubstitute/statuses/2dac4f0ffa64aa39446c1009ff51b1b00188e9ae"}}}}