public void PreservesCase() { var mem = new RamContents(); 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() ); }
public void NormalizesSlashes() { var mem = new RamContents(); mem.Xml(@"childhood\subdir/file", () => new XDocument(new XElement("root", new XElement("years", new XText("1980's"))))); Assert.Equal( @"childhood/subdir/file", new FirstOf <string>(mem.Knowledge("")).Value() ); }
public void KnowsAbsentXmlBytesAfterFirstRead() { var mem = new RamContents(); 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() ); }
public void UpdatesXNodeIfIgnored() { var contents = new RamContents(); new CachedContents( contents, new ManyOf <string>("a/*"), Int64.MaxValue ).UpdateXml( "a/b/c.dat", new XDocument(new XElement("elem", "content")) ); Assert.Equal( "<elem>content</elem>", contents.Xml("a/b/c.dat", () => new XDocument()).ToString() ); }