public void ListFilesWithDedupe() { var first = new InMemoryViewFolder { { "home\\three.txt", "three" }, { "home\\one.txt", "one" } }; var second = new InMemoryViewFolder { { "home\\two.txt", "two" }, { "home\\three.txt", "three" } }; var viewFolder = new CombinedViewFolder(first, second); var views = viewFolder.ListViews("home"); Assert.AreEqual(3, views.Count); Assert.Contains("home\\one.txt", views.ToArray()); Assert.Contains("home\\two.txt", views.ToArray()); Assert.Contains("home\\three.txt", views.ToArray()); }
public void SharingExtraFolders() { var normal = new FileSystemViewFolder("Spark.Tests.Views"); var otherLocation = new FileSystemViewFolder(Path.Combine("Spark.Tests.Views","Prefix")); var viewFolder = new CombinedViewFolder(normal, new SubViewFolder(otherLocation, "Shared")); var normalSharedCount = normal.ListViews("Shared").Count; var otherLocationCount = otherLocation.ListViews("").Count; var totalSharedCount = viewFolder.ListViews("Shared").Count; Assert.AreEqual(normalSharedCount + otherLocationCount, totalSharedCount); }