XmlData Value 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 string Value { get; set; }

Property Value

Type: String
Remarks

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

8 unit tests call DeltaEngine.Content.Xml.XmlData.Value
[Test]
public void AddChildViaNameAndValueWillOnlyAddTheValueIfNotNull()
{
    var node = new XmlData("Root");
    Assert.IsNull(node.AddChild("Child").Value);
    Assert.IsNull(node.AddChild("Child", null).Value);
    Assert.IsEmpty(node.AddChild("Child", "").Value);
    Assert.AreEqual(4.ToString(), node.AddChild("Child", 4).Value);
}
[Test]
public void Value()
{
    var root = new XmlData("root") { Value = "value" };
    Assert.AreEqual("value", root.Value);
}
[Test]
public void GetDescendantValue()
{
    XmlData root = CreateDeepTestXmlData();
    Assert.AreEqual("Value5", root.GetDescendantValue("Attr5"));
    Assert.AreEqual("", root.GetDescendantValue("Attr6"));
}
See Also