Пример #1
0
 public void RootNodeIsCaseSensitive()
 {
     using (var temp = new TempDirectory())
     {
         var xoc = new FileXocument(temp.Value().FullName + "/TheXoc.xml");
         Assert.Equal(1, xoc.Nodes("/TheXoc").Count);
     }
 }
Пример #2
0
 public void HasRootNode()
 {
     using (var temp = new TempDirectory())
     {
         var xoc = new FileXocument(temp.Value().FullName + "/catalog.xml");
         Assert.Equal(1, xoc.Nodes("/catalog").Count);
     }
 }
Пример #3
0
 public void UpdatesXocument()
 {
     using (var temp = new TempDirectory())
     {
         var xoc = new FileXocument(temp.Value().FullName + "/xoc.xml");
         xoc.Modify(new Directives()
                    .Xpath("/xoc")
                    .Add("aNode")
                    .Set("a value")
                    );
         Assert.Equal(
             "a value",
             xoc.Value("/xoc/aNode/text()", "")
             );
     }
 }
Пример #4
0
 public void ReturnsValues()
 {
     using (var temp = new TempDirectory())
     {
         var xoc = new FileXocument(temp.Value().FullName + "/xoc.xml");
         xoc.Modify(new Directives()
                    .Xpath("/xoc")
                    .Add("aNode")
                    .Set("a value")
                    .Up()
                    .Add("aNode")
                    .Set("another value")
                    );
         Assert.Equal(
             2,
             xoc.Values("/xoc/aNode/text()").Count
             );
     }
 }