public void HasViewBoolean() { var fileExists = _viewFolder.HasView("Home\\foreach.spark"); var fileNotFound = _viewFolder.HasView("Home\\fakefile.spark"); Assert.IsTrue(fileExists); Assert.IsFalse(fileNotFound); }
public void HasViewBoolean() { var fileExists = _viewFolder.HasView(Path.Combine("Home", "foreach.spark")); var fileNotFound = _viewFolder.HasView(Path.Combine("Home", "fakefile.spark")); Assert.IsTrue(fileExists); Assert.IsFalse(fileNotFound); }
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 bool HasView(string path) { return(_cache.HasView(path) || _disk.HasView(path)); }