public void ListingViewsInFolder() { var shared = _viewFolder.ListViews("Shared"); Assert.That(shared.Contains("_comment.spark")); Assert.That(shared.Contains("layout.spark")); Assert.That(shared.Contains("partial.spark")); }
public void SharingExtraFolders() { var normal = new FileSystemViewFolder("Spark.Tests.Views"); var otherLocation = new FileSystemViewFolder("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); }
public void ListViewsSameResults() { var filesystem = new FileSystemViewFolder("FileSystem\\Embedded"); Assert.IsTrue(filesystem.HasView("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 IList <string> ListViews(string path) { return(_disk.ListViews(path)); }