public void document3() { PropertyTreeNodeWriter writer = new PropertyTreeNodeWriter(); writer.WriteStartDocument(); writer.WriteStartTree("hello"); writer.WriteStartProperty("george"); writer.WritePropertyValue("burdell"); writer.WriteEndProperty(); writer.WriteStartProperty("buzz"); writer.WritePropertyValue("234"); writer.WriteEndProperty(); writer.WriteProperty("hey", "arnold"); writer.WriteEndTree(); writer.WriteEndDocument(); Assert.Equal(3, writer.Root.Children.Count); Assert.Equal(new [] { "george", "buzz", "hey" }, writer.Root.Children.Select(t => t.Name).ToArray()); Assert.NotNull(writer.Root.Children["buzz"]); Assert.NotNull(writer.Root["buzz"]); }
public void document2() { PropertyTreeNodeWriter writer = new PropertyTreeNodeWriter(); writer.WriteStartDocument(); writer.WriteStartTree("hello"); writer.WriteStartProperty("george"); writer.WritePropertyValue("burdell"); writer.WriteEndProperty(); writer.WriteEndTree(); writer.WriteEndDocument(); Assert.Equal(1, writer.Root.Children.Count); Assert.NotNull(writer.Root.Children["george"]); Assert.NotNull(writer.Root["george"]); Assert.Equal("burdell", writer.Root["george"].Value); }