public void OpenFileStream() { var first = new InMemoryViewFolder { { "one.txt", "one" } }; var second = new InMemoryViewFolder { { "two.txt", "two" } }; var viewFolder = new CombinedViewFolder(first, second); using (var reader = new StreamReader(viewFolder.GetViewSource("one.txt").OpenViewStream())) { var content = reader.ReadToEnd(); Assert.AreEqual("one", content); } using (var reader = new StreamReader(viewFolder.GetViewSource("two.txt").OpenViewStream())) { var content = reader.ReadToEnd(); Assert.AreEqual("two", content); } }
public void OpenMissingFile() { var first = new InMemoryViewFolder { { "one.txt", "one" } }; var second = new InMemoryViewFolder { { "two.txt", "two" } }; var viewFolder = new CombinedViewFolder(first, second); viewFolder.GetViewSource("three.txt"); }
public void OpenMissingFile() { var first = new InMemoryViewFolder { { "one.txt", "one" } }; var second = new InMemoryViewFolder { { "two.txt", "two" } }; var viewFolder = new CombinedViewFolder(first, second); Assert.That(() => viewFolder.GetViewSource("three.txt"), Throws.TypeOf<FileNotFoundException>()); }