XmlData Children Property Delta Engine Documentation

Namespace: DeltaEngine.Content.Xml
Assembly: DeltaEngine.Content.Xml (in DeltaEngine.Content.Xml.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public List<XmlData> Children { get; }

Property Value

Type: List XmlData 
Remarks

Tests: DeltaEngine.Content.Xml.Tests.XmlDataTests
Examples

2 unit tests call DeltaEngine.Content.Xml.XmlData.Children
[Test]
public void GetChildren()
{
    var root = new XmlData("root");
    var child1 = new XmlData("child");
    root.AddChild(child1);
    root.AddChild(new XmlData("stepchild"));
    var child2 = new XmlData("child");
    root.AddChild(child2);
    var children = root.GetChildren("child");
    Assert.AreEqual(2, children.Count);
    Assert.IsTrue(children.Contains(child1));
    Assert.IsTrue(children.Contains(child2));
}
[Test]
public void GetDefaultChildren()
{
    var root = new XmlData("root");
    var child1 = new XmlData("Child1") { Value = "testValue" };
    root.AddChild(child1);
    Assert.AreEqual(child1.Value, root.GetChildValue("Child1", root.Value));
    Assert.AreEqual(root.Value, root.GetChildValue("default", root.Value));
}
See Also