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 ); } }