public void RootNodeIsCaseSensitive() { using (var temp = new TempDirectory()) { var xoc = new FileXocument(temp.Value().FullName + "/TheXoc.xml"); Assert.Equal(1, xoc.Nodes("/TheXoc").Count); } }
public void HasRootNode() { using (var temp = new TempDirectory()) { var xoc = new FileXocument(temp.Value().FullName + "/catalog.xml"); Assert.Equal(1, xoc.Nodes("/catalog").Count); } }
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()", "") ); } }
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 ); } }