diff options
author | Mike Kestner <mkestner@gmail.com> | 2002-03-03 02:05:24 +0300 |
---|---|---|
committer | Mike Kestner <mkestner@gmail.com> | 2002-03-03 02:05:24 +0300 |
commit | 7745d16d5de75920c99a65efa744d6f8138217ae (patch) | |
tree | 1bff5885eb94c0aa72637239771205116f5befcb /mcs/class/System.XML/Test/XmlAttributeTests.cs | |
parent | 91103232ecd0251d1d451fe003df38f478e747c1 (diff) |
In Test:
2002-03-02 Mike Kestner <mkestner@speakeasy.net>
* XmlAttributeTests.cs : New test suite for attrs.
* AllTests.cs : Add the attr suite.
In System.Xml:
2002-03-02 Mike Kestner <mkestner@speakeasy.net>
* XmlAttribute.cs : Using fix.
* XmlDocument.cs (CreateAttribute(String)): Implement.
svn path=/trunk/mcs/; revision=2847
Diffstat (limited to 'mcs/class/System.XML/Test/XmlAttributeTests.cs')
-rw-r--r-- | mcs/class/System.XML/Test/XmlAttributeTests.cs | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/mcs/class/System.XML/Test/XmlAttributeTests.cs b/mcs/class/System.XML/Test/XmlAttributeTests.cs new file mode 100644 index 00000000000..22f1a0e2632 --- /dev/null +++ b/mcs/class/System.XML/Test/XmlAttributeTests.cs @@ -0,0 +1,64 @@ +// XmlAttributeTests.cs : Tests for the XmlAttribute class +// +// Author: Mike Kestner <mkestner@speakeasy.net> +// +// <c> 2002 Mike Kestner + +using System; +using System.Xml; + +using NUnit.Framework; + +namespace Ximian.Mono.Tests +{ + public class XmlAttributeTests : TestCase + { + public XmlAttributeTests() : base("Ximian.Mono.Tests.XmlAttributeTests testsuite") { } + public XmlAttributeTests(string name) : base(name) { } + + XmlDocument doc; + XmlAttribute attr; + + protected override void SetUp() + { + doc = new XmlDocument(); + attr = doc.CreateAttribute("attr1"); + attr.Value = "val1"; + } + + public void TestAttributes() + { + AssertNotNull(attr.Attributes); + } + + public void TestHasChildNodes() + { + Assert("Child nodes not allowed", attr.HasChildNodes); + } + + public void TestName() + { + AssertEquals("attr1", attr.Name); + } + + public void TestNodeType() + { + AssertEquals(XmlNodeType.Attribute, attr.NodeType); + } + + public void TestOwnerDocument() + { + AssertSame(doc, attr.OwnerDocument); + } + + public void TestParentNode() + { + AssertNull("Attr parents not allowed", attr.ParentNode); + } + + public void TestValue() + { + AssertEquals("val1", attr.Value); + } + } +} |