コード例 #1
0
        public void MergesIfNameEqual()
        {
            using (var temp = new TempDirectory())
            {
                var comb =
                    new MemorizedComb("comb",
                                      new FileMnemonic(temp.Value().FullName)
                                      );

                comb.Cell("some-data")
                .Update(new InputOf("<some-data/>"));

                comb.Xocument("some-data")
                .Modify(
                    new Directives()
                    .Xpath("/some-data")
                    .Add("newElement").Set("content")
                    );

                Assert.Equal(
                    "1",
                    comb.Xocument("_guts.xml")
                    .Value("count(/items/item)", "0")
                    );
            }
        }
コード例 #2
0
        public void GutsIncludeData()
        {
            var comb = new MemorizedComb("the name", new RamMnemonic());

            comb.Cell("cell").Update(new InputOf("cool text"));

            var values =
                comb.Xocument("_guts.xml")
                .Values("/items/item/name/text()");

            Assert.Single(new Filtered <string>((text) => text.Equals("cell"), values));
        }