コード例 #1
0
        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()
                );
        }
コード例 #2
0
        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()
                );
        }
コード例 #3
0
        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()
                );
        }
コード例 #4
0
        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()
                );
        }