Пример #1
0
        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"));
        }
Пример #2
0
        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);
        }
Пример #3
0
        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"));
        }
Пример #4
0
 public IList <string> ListViews(string path)
 {
     return(_disk.ListViews(path));
 }