XmlDataTests GetAttributes Method Delta Engine Documentation

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

public void GetAttributes()
Examples

[Test]
public void GetAttributesAsDictionary()
{
    XmlData root = CreateDeepTestXmlData();
    var dict = root.Children[0].GetAttributesAsDictionary();
    Assert.AreEqual(2, dict.Count);
    Assert.AreEqual("Value1", dict["Attr1"]);
    Assert.AreEqual("Value2", dict["Attr2"]);
}
[Test]
public void GetAttributes()
{
    XmlData root = CreateShallowTestXmlData();
    List<XmlAttribute> attributes = root.Children[0].Attributes;
    Assert.AreEqual(2, attributes.Count);
    Assert.AreEqual("Value1", attributes[0].Value);
    Assert.AreEqual("Value2", attributes[1].Value);
}
See Also