Namespace: DeltaEngine.Content.Xml
Assembly: DeltaEngine.Content.Xml (in DeltaEngine.Content.Xml.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Content.Xml.Tests.XmlDataTests
5 unit tests call DeltaEngine.Content.Xml.XmlData.GetAttributeValue(System.String)
Assembly: DeltaEngine.Content.Xml (in DeltaEngine.Content.Xml.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- attributeName
- Type: System String
Return Value
Type: StringRemarks
Examples
[Test] public void GetAttributeValue() { var root = new XmlData("root"); root.AddAttribute("attribute", "value"); Assert.AreEqual("value", root.GetAttributeValue("attribute")); Assert.AreEqual("", root.GetAttributeValue("attribute2")); }
[Test] public void GetAttributeValueAsInteger() { var root = new XmlData("root"); root.AddAttribute("number", "123"); Assert.AreEqual(123, root.GetAttributeValue("number", 0)); Assert.AreEqual("", root.GetAttributeValue("nonexistant", "")); }
[Test] public void UpdateExistingAttribute() { var root = new XmlData("root"); root.AddAttribute("number", "123"); root.UpdateAttribute("number", "312"); Assert.AreEqual("312", root.GetAttributeValue("number")); }
See Also