public void ListViewsSameResults() { var filesystem = new FileSystemViewFolder(Path.Combine("FileSystem", "Embedded")); Assert.IsTrue(filesystem.HasView(Path.Combine("Home", "Index.spark"))); var files = filesystem.ListViews("Home"); Assert.AreEqual(2, files.Count); Assert.That(files.Any(f => Path.GetFileName(f) == "Index.spark")); Assert.That(files.Any(f => Path.GetFileName(f) == "List.spark")); var embedded = new EmbeddedViewFolder(Assembly.Load("Spark.Tests"), "Spark.Tests.FileSystem.Embedded"); files = embedded.ListViews("home"); Assert.AreEqual(2, files.Count); Assert.That(files.Any(f => Path.GetFileName(f) == "Index.spark")); Assert.That(files.Any(f => Path.GetFileName(f) == "List.spark")); }
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); }