{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/comments/35843542","id":35843542,"diff_hunk":"@@ -70,73 +105,83 @@ public void NonGeneric_GetRequiredServices_Returns_SingleService()\n         }\n \n         [Fact]\n-        public void GetRequiredServices_Returns_CorrectTypes()\n+        public void GetServices_Returns_CorrectTypes()\n         {\n             // Arrange\n             var serviceProvider = CreateTestServiceProvider(4);\n \n             // Act\n-            var services = serviceProvider.GetRequiredServices(typeof(IAnotherFoo));\n+            var services = serviceProvider.GetServices(typeof(IBar));\n \n             // Assert\n             foreach (var service in services)\n             {\n-                Assert.IsAssignableFrom<IAnotherFoo>(service);\n+                Assert.IsAssignableFrom<IBar>(service);\n             }\n             Assert.Equal(2, services.Count());\n         }\n \n         [Fact]\n-        public void Throws_WhenNo_Services_AreRegistered()\n+        public void GetServices_Returns_EmptyArray_WhenNoServicesAvailable()\n         {\n             // Arrange\n             var serviceProvider = CreateTestServiceProvider(0);\n \n-            // Act + Assert\n-            ExceptionAssert.Throws<InvalidOperationException>(() => serviceProvider.GetRequiredServices<IFoo>(),\n-                $\"No service for type '{typeof(IFoo)}' has been registered.\");\n+            // Act\n+            var services = serviceProvider.GetServices<IFoo>();\n+\n+            // Assert\n+            Assert.Empty(services);\n+            Assert.IsType<IFoo[]>(services);\n         }\n \n         [Fact]\n-        public void Throws_WhenNo_Services_AreRegistered_NonGeneric()\n+        public void NonGeneric_GetServices_Returns_EmptyArray_WhenNoServicesAvailable()\n         {\n             // Arrange\n             var serviceProvider = CreateTestServiceProvider(0);\n \n-            // Act + Assert\n-            ExceptionAssert.Throws<InvalidOperationException>(() => serviceProvider.GetRequiredServices(typeof(IFoo)),\n-                $\"No service for type '{typeof(IFoo)}' has been registered.\");\n+            // Act\n+            var services = serviceProvider.GetServices(typeof(IFoo));\n+\n+            // Assert\n+            Assert.Empty(services);\n+            Assert.IsType<IFoo[]>(services);\n         }\n \n         [Fact]\n-        public void Throws_WhenNo_Services_AreAvailable()\n+        public void GetServices_WithBuildServiceProvider_Returns_EmptyList_WhenNoServicesAvailable()\n         {\n             // Arrange\n             var serviceCollection = new ServiceCollection();\n             serviceCollection.AddInstance<IEnumerable<IFoo>>(new List<IFoo>());\n-\n             var serviceProvider = serviceCollection.BuildServiceProvider();\n \n-            // Act + Assert\n-            ExceptionAssert.Throws<InvalidOperationException>(() => serviceProvider.GetRequiredServices<IFoo>(),\n-                $\"No service for type '{typeof(IFoo)}' has been registered.\");\n+            // Act\n+            var services = serviceProvider.GetServices<IFoo>();\n+\n+            // Assert\n+            Assert.Empty(services);\n+            Assert.IsType<List<IFoo>>(services);\n         }\n \n         [Fact]\n-        public void Throws_WhenNo_Services_AreAvailable_NonGeneric()\n+        public void NonGeneric_GetServices_WithBuildServiceProvider_Returns_EmptyList_WhenNoServicesAvailable()\n         {\n             // Arrange\n             var serviceCollection = new ServiceCollection();","path":"test/Microsoft.Framework.DependencyInjection.Tests/ServiceProviderExtensionsTest.cs","position":184,"original_position":184,"commit_id":"c63f2e266d14b94981916a04da35d3b699acbf00","original_commit_id":"c63f2e266d14b94981916a04da35d3b699acbf00","user":{"login":"henkmollema","id":1521207,"avatar_url":"https://avatars.githubusercontent.com/u/1521207?v=3","gravatar_id":"","url":"https://api.github.com/users/henkmollema","html_url":"https://github.com/henkmollema","followers_url":"https://api.github.com/users/henkmollema/followers","following_url":"https://api.github.com/users/henkmollema/following{/other_user}","gists_url":"https://api.github.com/users/henkmollema/gists{/gist_id}","starred_url":"https://api.github.com/users/henkmollema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henkmollema/subscriptions","organizations_url":"https://api.github.com/users/henkmollema/orgs","repos_url":"https://api.github.com/users/henkmollema/repos","events_url":"https://api.github.com/users/henkmollema/events{/privacy}","received_events_url":"https://api.github.com/users/henkmollema/received_events","type":"User","site_admin":false},"body":"@pranavkm what's your opinion on this?","created_at":"2015-07-30T07:01:57Z","updated_at":"2015-07-30T07:01:57Z","html_url":"https://github.com/aspnet/DependencyInjection/pull/269#discussion_r35843542","pull_request_url":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/269","_links":{"self":{"href":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/comments/35843542"},"html":{"href":"https://github.com/aspnet/DependencyInjection/pull/269#discussion_r35843542"},"pull_request":{"href":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/269"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/269","id":41096843,"html_url":"https://github.com/aspnet/DependencyInjection/pull/269","diff_url":"https://github.com/aspnet/DependencyInjection/pull/269.diff","patch_url":"https://github.com/aspnet/DependencyInjection/pull/269.patch","issue_url":"https://api.github.com/repos/aspnet/DependencyInjection/issues/269","number":269,"state":"open","locked":false,"title":"Replace GetServices with GetRequiredServices","user":{"login":"henkmollema","id":1521207,"avatar_url":"https://avatars.githubusercontent.com/u/1521207?v=3","gravatar_id":"","url":"https://api.github.com/users/henkmollema","html_url":"https://github.com/henkmollema","followers_url":"https://api.github.com/users/henkmollema/followers","following_url":"https://api.github.com/users/henkmollema/following{/other_user}","gists_url":"https://api.github.com/users/henkmollema/gists{/gist_id}","starred_url":"https://api.github.com/users/henkmollema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henkmollema/subscriptions","organizations_url":"https://api.github.com/users/henkmollema/orgs","repos_url":"https://api.github.com/users/henkmollema/repos","events_url":"https://api.github.com/users/henkmollema/events{/privacy}","received_events_url":"https://api.github.com/users/henkmollema/received_events","type":"User","site_admin":false},"body":"GetServices returns an emty array or list rather than throwing an exception when there are no services registered. The consumer should check with `Any()` if there are any services.\r\n\r\nAdded tests for every method in `ServiceProviderExtensions`\r\n\r\n#241 ","created_at":"2015-07-29T08:07:57Z","updated_at":"2015-07-30T07:01:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9b8643f68055488b47018269071da7ddcefe190","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/269/commits","review_comments_url":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/269/comments","review_comment_url":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/DependencyInjection/issues/269/comments","statuses_url":"https://api.github.com/repos/aspnet/DependencyInjection/statuses/c63f2e266d14b94981916a04da35d3b699acbf00","head":{"label":"henkmollema:add-GetServices","ref":"add-GetServices","sha":"c63f2e266d14b94981916a04da35d3b699acbf00","user":{"login":"henkmollema","id":1521207,"avatar_url":"https://avatars.githubusercontent.com/u/1521207?v=3","gravatar_id":"","url":"https://api.github.com/users/henkmollema","html_url":"https://github.com/henkmollema","followers_url":"https://api.github.com/users/henkmollema/followers","following_url":"https://api.github.com/users/henkmollema/following{/other_user}","gists_url":"https://api.github.com/users/henkmollema/gists{/gist_id}","starred_url":"https://api.github.com/users/henkmollema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henkmollema/subscriptions","organizations_url":"https://api.github.com/users/henkmollema/orgs","repos_url":"https://api.github.com/users/henkmollema/repos","events_url":"https://api.github.com/users/henkmollema/events{/privacy}","received_events_url":"https://api.github.com/users/henkmollema/received_events","type":"User","site_admin":false},"repo":{"id":34791343,"name":"DependencyInjection","full_name":"henkmollema/DependencyInjection","owner":{"login":"henkmollema","id":1521207,"avatar_url":"https://avatars.githubusercontent.com/u/1521207?v=3","gravatar_id":"","url":"https://api.github.com/users/henkmollema","html_url":"https://github.com/henkmollema","followers_url":"https://api.github.com/users/henkmollema/followers","following_url":"https://api.github.com/users/henkmollema/following{/other_user}","gists_url":"https://api.github.com/users/henkmollema/gists{/gist_id}","starred_url":"https://api.github.com/users/henkmollema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henkmollema/subscriptions","organizations_url":"https://api.github.com/users/henkmollema/orgs","repos_url":"https://api.github.com/users/henkmollema/repos","events_url":"https://api.github.com/users/henkmollema/events{/privacy}","received_events_url":"https://api.github.com/users/henkmollema/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/henkmollema/DependencyInjection","description":"Contains the common DI abstractions that ASP.NET and EF vNext use, as well as adapters for some IoC containers.","fork":true,"url":"https://api.github.com/repos/henkmollema/DependencyInjection","forks_url":"https://api.github.com/repos/henkmollema/DependencyInjection/forks","keys_url":"https://api.github.com/repos/henkmollema/DependencyInjection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/henkmollema/DependencyInjection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/henkmollema/DependencyInjection/teams","hooks_url":"https://api.github.com/repos/henkmollema/DependencyInjection/hooks","issue_events_url":"https://api.github.com/repos/henkmollema/DependencyInjection/issues/events{/number}","events_url":"https://api.github.com/repos/henkmollema/DependencyInjection/events","assignees_url":"https://api.github.com/repos/henkmollema/DependencyInjection/assignees{/user}","branches_url":"https://api.github.com/repos/henkmollema/DependencyInjection/branches{/branch}","tags_url":"https://api.github.com/repos/henkmollema/DependencyInjection/tags","blobs_url":"https://api.github.com/repos/henkmollema/DependencyInjection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/henkmollema/DependencyInjection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/henkmollema/DependencyInjection/git/refs{/sha}","trees_url":"https://api.github.com/repos/henkmollema/DependencyInjection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/henkmollema/DependencyInjection/statuses/{sha}","languages_url":"https://api.github.com/repos/henkmollema/DependencyInjection/languages","stargazers_url":"https://api.github.com/repos/henkmollema/DependencyInjection/stargazers","contributors_url":"https://api.github.com/repos/henkmollema/DependencyInjection/contributors","subscribers_url":"https://api.github.com/repos/henkmollema/DependencyInjection/subscribers","subscription_url":"https://api.github.com/repos/henkmollema/DependencyInjection/subscription","commits_url":"https://api.github.com/repos/henkmollema/DependencyInjection/commits{/sha}","git_commits_url":"https://api.github.com/repos/henkmollema/DependencyInjection/git/commits{/sha}","comments_url":"https://api.github.com/repos/henkmollema/DependencyInjection/comments{/number}","issue_comment_url":"https://api.github.com/repos/henkmollema/DependencyInjection/issues/comments{/number}","contents_url":"https://api.github.com/repos/henkmollema/DependencyInjection/contents/{+path}","compare_url":"https://api.github.com/repos/henkmollema/DependencyInjection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/henkmollema/DependencyInjection/merges","archive_url":"https://api.github.com/repos/henkmollema/DependencyInjection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/henkmollema/DependencyInjection/downloads","issues_url":"https://api.github.com/repos/henkmollema/DependencyInjection/issues{/number}","pulls_url":"https://api.github.com/repos/henkmollema/DependencyInjection/pulls{/number}","milestones_url":"https://api.github.com/repos/henkmollema/DependencyInjection/milestones{/number}","notifications_url":"https://api.github.com/repos/henkmollema/DependencyInjection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/henkmollema/DependencyInjection/labels{/name}","releases_url":"https://api.github.com/repos/henkmollema/DependencyInjection/releases{/id}","created_at":"2015-04-29T12:00:17Z","updated_at":"2015-05-08T10:36:15Z","pushed_at":"2015-07-29T08:07:19Z","git_url":"git://github.com/henkmollema/DependencyInjection.git","ssh_url":"git@github.com:henkmollema/DependencyInjection.git","clone_url":"https://github.com/henkmollema/DependencyInjection.git","svn_url":"https://github.com/henkmollema/DependencyInjection","homepage":"","size":715,"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":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"802c34f4072d0ab98590fe87c94084b9f6c07075","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":15814195,"name":"DependencyInjection","full_name":"aspnet/DependencyInjection","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/DependencyInjection","description":"Contains the common DI abstractions that ASP.NET 5 and EF 7 use, as well as adapters for some IoC containers.","fork":false,"url":"https://api.github.com/repos/aspnet/DependencyInjection","forks_url":"https://api.github.com/repos/aspnet/DependencyInjection/forks","keys_url":"https://api.github.com/repos/aspnet/DependencyInjection/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/DependencyInjection/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/DependencyInjection/teams","hooks_url":"https://api.github.com/repos/aspnet/DependencyInjection/hooks","issue_events_url":"https://api.github.com/repos/aspnet/DependencyInjection/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/DependencyInjection/events","assignees_url":"https://api.github.com/repos/aspnet/DependencyInjection/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/DependencyInjection/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/DependencyInjection/tags","blobs_url":"https://api.github.com/repos/aspnet/DependencyInjection/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/DependencyInjection/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/DependencyInjection/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/DependencyInjection/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/DependencyInjection/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/DependencyInjection/languages","stargazers_url":"https://api.github.com/repos/aspnet/DependencyInjection/stargazers","contributors_url":"https://api.github.com/repos/aspnet/DependencyInjection/contributors","subscribers_url":"https://api.github.com/repos/aspnet/DependencyInjection/subscribers","subscription_url":"https://api.github.com/repos/aspnet/DependencyInjection/subscription","commits_url":"https://api.github.com/repos/aspnet/DependencyInjection/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/DependencyInjection/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/DependencyInjection/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/DependencyInjection/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/DependencyInjection/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/DependencyInjection/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/DependencyInjection/merges","archive_url":"https://api.github.com/repos/aspnet/DependencyInjection/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/DependencyInjection/downloads","issues_url":"https://api.github.com/repos/aspnet/DependencyInjection/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/DependencyInjection/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/DependencyInjection/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/DependencyInjection/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/DependencyInjection/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/DependencyInjection/releases{/id}","created_at":"2014-01-11T00:58:01Z","updated_at":"2015-07-30T06:24:38Z","pushed_at":"2015-07-29T08:07:57Z","git_url":"git://github.com/aspnet/DependencyInjection.git","ssh_url":"git@github.com:aspnet/DependencyInjection.git","clone_url":"https://github.com/aspnet/DependencyInjection.git","svn_url":"https://github.com/aspnet/DependencyInjection","homepage":"","size":3309,"stargazers_count":220,"watchers_count":220,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":95,"mirror_url":null,"open_issues_count":34,"forks":95,"open_issues":34,"watchers":220,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/269"},"html":{"href":"https://github.com/aspnet/DependencyInjection/pull/269"},"issue":{"href":"https://api.github.com/repos/aspnet/DependencyInjection/issues/269"},"comments":{"href":"https://api.github.com/repos/aspnet/DependencyInjection/issues/269/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/269/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/DependencyInjection/pulls/269/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/DependencyInjection/statuses/c63f2e266d14b94981916a04da35d3b699acbf00"}}}}