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");
        }
示例#3
0
        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>());
        }