public void ShouldLoadFromDiskIfPathInCacheWithNullData() { string path = "Shared\\Application.spark"; string contents = String.Empty; var cache = new CachingViewFolder(ROOT_VIEW_PATH); cache.Add(path); var content = cache.GetViewSource(path); using (TextReader reader = new StreamReader(content.OpenViewStream())) contents = reader.ReadToEnd(); Assert.That(contents.Contains("no header by default")); }
public void ShouldLoadFromDiskIfPathInCacheWithNullData() { string path = "Shared\\Application.spark"; string contents = String.Empty; var cache = new CachingViewFolder(ROOT_VIEW_PATH); cache.Add(path); var content = cache.GetViewSource(path); using (TextReader reader = new StreamReader(content.OpenViewStream())) contents = reader.ReadToEnd(); Assert.That(contents.Contains("no header by default")); }
public void ShouldAllowCacheContentToBeReplaced() { string path = "Shared\\test.spark"; string contents = String.Empty; var cache = new CachingViewFolder(ROOT_VIEW_PATH); cache.Add(path); string newContent = "This is new content"; cache.SetViewSource(path, newContent); var content = cache.GetViewSource(path); using (TextReader reader = new StreamReader(content.OpenViewStream())) contents = reader.ReadToEnd(); Assert.That(contents.Contains(newContent)); }
public void ShouldAllowCacheContentToBeReplaced() { string path = "Shared\\test.spark"; string contents = String.Empty; var cache = new CachingViewFolder(ROOT_VIEW_PATH); cache.Add(path); string newContent = "This is new content"; cache.SetViewSource(path, newContent); var content = cache.GetViewSource(path); using (TextReader reader = new StreamReader(content.OpenViewStream())) contents = reader.ReadToEnd(); Assert.That(contents.Contains(newContent)); }