Exemplo n.º 1
0
 public void KnowledgePreservesCase()
 {
     using (var dir = new TempDirectory())
     {
         var root = dir.Value().FullName;
         var mem  = new FileContents(root, new LocalSyncPipe());
         mem.Xml(@"BIG\subdir/file", () => new XDocument(new XElement("root", new XElement("years", new XText("1980's")))));
         Assert.Equal(
             "BIG/subdir/file",
             new FirstOf <string>(mem.Knowledge()).Value()
             );
     }
 }
Exemplo n.º 2
0
        public void KnowsAbsentXmlBytesAfterFirstRead()
        {
            using (var dir = new TempDirectory())
            {
                var root = dir.Value().FullName;
                var mem  = new FileContents(root, new LocalSyncPipe());
                mem.Xml("a/b/c.xml", () => new XDocument(new XElement("elem", "content"))).ToString();

                Assert.Equal(
                    "<elem>content</elem>",
                    new TextOf(mem.Bytes("a/b/c.xml", () => new byte[0])).AsString()
                    );
            }
        }