{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/FileSystem/pulls/comments/45885330","id":45885330,"diff_hunk":"@@ -0,0 +1,252 @@\n+// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n+\n+using System;\n+using System.Linq;\n+using Microsoft.AspNet.FileProviders.Combined.Tests.TestUtility;\n+using Xunit;\n+using System.Collections.Generic;\n+using Microsoft.Extensions.Primitives;\n+\n+namespace Microsoft.AspNet.FileProviders.Embedded.Tests\n+{\n+    public class CombinedFileProviderTests\n+    {\n+        [Fact]\n+        public void GetFileInfo_ReturnsNotFoundFileInfo_IfNoFileProviderSpecified()\n+        {\n+            // Arrange\n+            var provider = new CombinedFileProvider();\n+\n+            // Act\n+            var fileInfo = provider.GetFileInfo(\"DoesNotExist.txt\");\n+\n+            // Assert\n+            Assert.NotNull(fileInfo);\n+            Assert.False(fileInfo.Exists);\n+        }\n+\n+        [Fact]\n+        public void GetFileInfo_ReturnsNotFoundFileInfo_IfFileDoesNotExist()\n+        {\n+            // Arrange\n+            var provider = new CombinedFileProvider(new MockFileProvider(new MockFileInfo(\"DoesExist.txt\")));\n+\n+            // Act\n+            var fileInfo = provider.GetFileInfo(\"DoesNotExist.txt\");\n+\n+            // Assert\n+            Assert.NotNull(fileInfo);\n+            Assert.False(fileInfo.Exists);\n+        }\n+\n+        [Fact]\n+        public void GetFileInfo_ReturnsTheFirstFoundFileInfo()\n+        {\n+            // Arrange\n+            var fileName = \"File1\";\n+            var expectedFileInfo = new MockFileInfo(fileName);\n+            var provider = new CombinedFileProvider(\n+                new MockFileProvider(\n+                    new MockFileInfo(\"FileA\"),\n+                    new MockFileInfo(\"FileB\")\n+                    ),\n+                new MockFileProvider(\n+                    expectedFileInfo,\n+                    new MockFileInfo(\"File2\")\n+                    ),\n+                new MockFileProvider(\n+                    new MockFileInfo(fileName),\n+                    new MockFileInfo(\"File3\")\n+                    )\n+                );\n+\n+            // Act\n+            var fileInfo = provider.GetFileInfo(fileName);\n+\n+            // Assert\n+            Assert.NotNull(fileInfo);\n+            Assert.True(fileInfo.Exists);\n+            Assert.Equal(expectedFileInfo, fileInfo);\n+        }\n+\n+        [Fact]\n+        public void GetDirectoryContents_ReturnsNonExistingEmptySequence_IfNoFileProviderSpecified()\n+        {\n+            // Arrange\n+            var provider = new CombinedFileProvider();\n+\n+            // Act\n+            var files = provider.GetDirectoryContents(string.Empty);\n+\n+            // Assert\n+            Assert.NotNull(files);\n+            Assert.False(files.Exists);\n+            Assert.Empty(files);\n+        }\n+\n+        [Fact]\n+        public void GetDirectoryContents_ReturnsNonExistingEmptySequence_IfResourcesDoNotExist()\n+        {\n+            // Arrange\n+            var provider = new CombinedFileProvider();\n+\n+            // Act\n+            var files = provider.GetDirectoryContents(\"DoesNotExist\");\n+\n+            // Assert\n+            Assert.NotNull(files);\n+            Assert.False(files.Exists);\n+            Assert.Empty(files);\n+        }\n+\n+        [Fact]\n+        public void GetDirectoryContents_ReturnsCombinaisionOFFiles()\n+        {\n+            // Arrange\n+            IFileInfo file1 = new MockFileInfo(\"File1\"),\n+                file2 = new MockFileInfo(\"File2\"),\n+                file2Bis = new MockFileInfo(\"File2\"),\n+                file3 = new MockFileInfo(\"File3\");\n+            var provider = new CombinedFileProvider(\n+                new MockFileProvider(\n+                    file1,\n+                    file2\n+                    ),","path":"test/Microsoft.AspNet.FileProviders.Combined.Tests/CombinedFileProviderTests.cs","position":115,"original_position":115,"commit_id":"1043d92c8e146bdedbd6bf9550f03e01d9cc83a9","original_commit_id":"1043d92c8e146bdedbd6bf9550f03e01d9cc83a9","user":{"login":"pranavkm","id":174281,"avatar_url":"https://avatars.githubusercontent.com/u/174281?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"body":"Formatting: put these parentheses on the previous line e.g. `file2),` ","created_at":"2015-11-25T16:12:34Z","updated_at":"2015-11-25T16:12:34Z","html_url":"https://github.com/aspnet/FileSystem/pull/142#discussion_r45885330","pull_request_url":"https://api.github.com/repos/aspnet/FileSystem/pulls/142","_links":{"self":{"href":"https://api.github.com/repos/aspnet/FileSystem/pulls/comments/45885330"},"html":{"href":"https://github.com/aspnet/FileSystem/pull/142#discussion_r45885330"},"pull_request":{"href":"https://api.github.com/repos/aspnet/FileSystem/pulls/142"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/FileSystem/pulls/142","id":51446457,"html_url":"https://github.com/aspnet/FileSystem/pull/142","diff_url":"https://github.com/aspnet/FileSystem/pull/142.diff","patch_url":"https://github.com/aspnet/FileSystem/pull/142.patch","issue_url":"https://api.github.com/repos/aspnet/FileSystem/issues/142","number":142,"state":"open","locked":false,"title":"Implement a CombinedFileProvider","user":{"login":"mgrosperrin","id":1014410,"avatar_url":"https://avatars.githubusercontent.com/u/1014410?v=3","gravatar_id":"","url":"https://api.github.com/users/mgrosperrin","html_url":"https://github.com/mgrosperrin","followers_url":"https://api.github.com/users/mgrosperrin/followers","following_url":"https://api.github.com/users/mgrosperrin/following{/other_user}","gists_url":"https://api.github.com/users/mgrosperrin/gists{/gist_id}","starred_url":"https://api.github.com/users/mgrosperrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgrosperrin/subscriptions","organizations_url":"https://api.github.com/users/mgrosperrin/orgs","repos_url":"https://api.github.com/users/mgrosperrin/repos","events_url":"https://api.github.com/users/mgrosperrin/events{/privacy}","received_events_url":"https://api.github.com/users/mgrosperrin/received_events","type":"User","site_admin":false},"body":"This PR is for the issue #49 \r\n\r\nThe behavior for each method is:\r\n1. `GetFileInfo`: returns the first `IFileInfo` of all provided `IFileProvider` where the `Exists` property is `true`,\r\n2. `GetDirectoryContents`: merges the the contents of all provided `IFileProvider`. On duplicate entries (based on `Name` property), only the first  entry is kept,\r\n3. `Watch`: returns a `IChangeToken` that merges the `IChangeToken` of all provided `IFileProvider`. When one of the token raises the change notification, the returned token raises it.\r\n","created_at":"2015-11-21T18:05:24Z","updated_at":"2015-11-25T16:12:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b202101279fcfd6cbe1153e33e30643f5020b4d1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/FileSystem/pulls/142/commits","review_comments_url":"https://api.github.com/repos/aspnet/FileSystem/pulls/142/comments","review_comment_url":"https://api.github.com/repos/aspnet/FileSystem/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/FileSystem/issues/142/comments","statuses_url":"https://api.github.com/repos/aspnet/FileSystem/statuses/1043d92c8e146bdedbd6bf9550f03e01d9cc83a9","head":{"label":"mgrosperrin:dev","ref":"dev","sha":"1043d92c8e146bdedbd6bf9550f03e01d9cc83a9","user":{"login":"mgrosperrin","id":1014410,"avatar_url":"https://avatars.githubusercontent.com/u/1014410?v=3","gravatar_id":"","url":"https://api.github.com/users/mgrosperrin","html_url":"https://github.com/mgrosperrin","followers_url":"https://api.github.com/users/mgrosperrin/followers","following_url":"https://api.github.com/users/mgrosperrin/following{/other_user}","gists_url":"https://api.github.com/users/mgrosperrin/gists{/gist_id}","starred_url":"https://api.github.com/users/mgrosperrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgrosperrin/subscriptions","organizations_url":"https://api.github.com/users/mgrosperrin/orgs","repos_url":"https://api.github.com/users/mgrosperrin/repos","events_url":"https://api.github.com/users/mgrosperrin/events{/privacy}","received_events_url":"https://api.github.com/users/mgrosperrin/received_events","type":"User","site_admin":false},"repo":{"id":46337954,"name":"FileSystem","full_name":"mgrosperrin/FileSystem","owner":{"login":"mgrosperrin","id":1014410,"avatar_url":"https://avatars.githubusercontent.com/u/1014410?v=3","gravatar_id":"","url":"https://api.github.com/users/mgrosperrin","html_url":"https://github.com/mgrosperrin","followers_url":"https://api.github.com/users/mgrosperrin/followers","following_url":"https://api.github.com/users/mgrosperrin/following{/other_user}","gists_url":"https://api.github.com/users/mgrosperrin/gists{/gist_id}","starred_url":"https://api.github.com/users/mgrosperrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgrosperrin/subscriptions","organizations_url":"https://api.github.com/users/mgrosperrin/orgs","repos_url":"https://api.github.com/users/mgrosperrin/repos","events_url":"https://api.github.com/users/mgrosperrin/events{/privacy}","received_events_url":"https://api.github.com/users/mgrosperrin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mgrosperrin/FileSystem","description":"Abstraction of file system APIs.","fork":true,"url":"https://api.github.com/repos/mgrosperrin/FileSystem","forks_url":"https://api.github.com/repos/mgrosperrin/FileSystem/forks","keys_url":"https://api.github.com/repos/mgrosperrin/FileSystem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mgrosperrin/FileSystem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mgrosperrin/FileSystem/teams","hooks_url":"https://api.github.com/repos/mgrosperrin/FileSystem/hooks","issue_events_url":"https://api.github.com/repos/mgrosperrin/FileSystem/issues/events{/number}","events_url":"https://api.github.com/repos/mgrosperrin/FileSystem/events","assignees_url":"https://api.github.com/repos/mgrosperrin/FileSystem/assignees{/user}","branches_url":"https://api.github.com/repos/mgrosperrin/FileSystem/branches{/branch}","tags_url":"https://api.github.com/repos/mgrosperrin/FileSystem/tags","blobs_url":"https://api.github.com/repos/mgrosperrin/FileSystem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mgrosperrin/FileSystem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mgrosperrin/FileSystem/git/refs{/sha}","trees_url":"https://api.github.com/repos/mgrosperrin/FileSystem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mgrosperrin/FileSystem/statuses/{sha}","languages_url":"https://api.github.com/repos/mgrosperrin/FileSystem/languages","stargazers_url":"https://api.github.com/repos/mgrosperrin/FileSystem/stargazers","contributors_url":"https://api.github.com/repos/mgrosperrin/FileSystem/contributors","subscribers_url":"https://api.github.com/repos/mgrosperrin/FileSystem/subscribers","subscription_url":"https://api.github.com/repos/mgrosperrin/FileSystem/subscription","commits_url":"https://api.github.com/repos/mgrosperrin/FileSystem/commits{/sha}","git_commits_url":"https://api.github.com/repos/mgrosperrin/FileSystem/git/commits{/sha}","comments_url":"https://api.github.com/repos/mgrosperrin/FileSystem/comments{/number}","issue_comment_url":"https://api.github.com/repos/mgrosperrin/FileSystem/issues/comments{/number}","contents_url":"https://api.github.com/repos/mgrosperrin/FileSystem/contents/{+path}","compare_url":"https://api.github.com/repos/mgrosperrin/FileSystem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mgrosperrin/FileSystem/merges","archive_url":"https://api.github.com/repos/mgrosperrin/FileSystem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mgrosperrin/FileSystem/downloads","issues_url":"https://api.github.com/repos/mgrosperrin/FileSystem/issues{/number}","pulls_url":"https://api.github.com/repos/mgrosperrin/FileSystem/pulls{/number}","milestones_url":"https://api.github.com/repos/mgrosperrin/FileSystem/milestones{/number}","notifications_url":"https://api.github.com/repos/mgrosperrin/FileSystem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mgrosperrin/FileSystem/labels{/name}","releases_url":"https://api.github.com/repos/mgrosperrin/FileSystem/releases{/id}","created_at":"2015-11-17T09:51:21Z","updated_at":"2015-11-17T09:51:22Z","pushed_at":"2015-11-24T18:24:52Z","git_url":"git://github.com/mgrosperrin/FileSystem.git","ssh_url":"git@github.com:mgrosperrin/FileSystem.git","clone_url":"https://github.com/mgrosperrin/FileSystem.git","svn_url":"https://github.com/mgrosperrin/FileSystem","homepage":"","size":463,"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":"5d9ae0147f000010184fcdc9704b589bf892c10d","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":16161950,"name":"FileSystem","full_name":"aspnet/FileSystem","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/FileSystem","description":"Abstraction of file system APIs.","fork":false,"url":"https://api.github.com/repos/aspnet/FileSystem","forks_url":"https://api.github.com/repos/aspnet/FileSystem/forks","keys_url":"https://api.github.com/repos/aspnet/FileSystem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/FileSystem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/FileSystem/teams","hooks_url":"https://api.github.com/repos/aspnet/FileSystem/hooks","issue_events_url":"https://api.github.com/repos/aspnet/FileSystem/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/FileSystem/events","assignees_url":"https://api.github.com/repos/aspnet/FileSystem/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/FileSystem/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/FileSystem/tags","blobs_url":"https://api.github.com/repos/aspnet/FileSystem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/FileSystem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/FileSystem/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/FileSystem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/FileSystem/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/FileSystem/languages","stargazers_url":"https://api.github.com/repos/aspnet/FileSystem/stargazers","contributors_url":"https://api.github.com/repos/aspnet/FileSystem/contributors","subscribers_url":"https://api.github.com/repos/aspnet/FileSystem/subscribers","subscription_url":"https://api.github.com/repos/aspnet/FileSystem/subscription","commits_url":"https://api.github.com/repos/aspnet/FileSystem/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/FileSystem/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/FileSystem/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/FileSystem/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/FileSystem/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/FileSystem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/FileSystem/merges","archive_url":"https://api.github.com/repos/aspnet/FileSystem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/FileSystem/downloads","issues_url":"https://api.github.com/repos/aspnet/FileSystem/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/FileSystem/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/FileSystem/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/FileSystem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/FileSystem/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/FileSystem/releases{/id}","created_at":"2014-01-23T04:09:34Z","updated_at":"2015-10-24T15:42:30Z","pushed_at":"2015-11-24T18:24:52Z","git_url":"git://github.com/aspnet/FileSystem.git","ssh_url":"git@github.com:aspnet/FileSystem.git","clone_url":"https://github.com/aspnet/FileSystem.git","svn_url":"https://github.com/aspnet/FileSystem","homepage":"","size":830,"stargazers_count":77,"watchers_count":77,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":28,"forks":37,"open_issues":28,"watchers":77,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/FileSystem/pulls/142"},"html":{"href":"https://github.com/aspnet/FileSystem/pull/142"},"issue":{"href":"https://api.github.com/repos/aspnet/FileSystem/issues/142"},"comments":{"href":"https://api.github.com/repos/aspnet/FileSystem/issues/142/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/FileSystem/pulls/142/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/FileSystem/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/FileSystem/pulls/142/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/FileSystem/statuses/1043d92c8e146bdedbd6bf9550f03e01d9cc83a9"}}}}