[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / class / System.XML / Test / System.Xml / XmlEntityTests.cs
blobca778b28018afb5d8876753f72ad6cf3ccd8096f
1 //
2 // System.Xml.XmlEntityTests.cs
3 //
4 // Author: Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
5 //
6 // (C) 2003 Atsushi Enomoto
7 //
9 using System;
10 using System.Xml;
12 using NUnit.Framework;
14 namespace MonoTests.System.Xml
16 [TestFixture]
17 public class XmlEntityTests
19 XmlDocument document;
20 XmlDocumentType docType;
22 [SetUp]
23 public void GetReady ()
25 document = new XmlDocument ();
26 docType = document.CreateDocumentType ("book", null, null, "<!ELEMENT book ANY>");
27 document.AppendChild (docType);
30 [Test]
31 public void TestValue ()
33 XmlTextReader xtr = new XmlTextReader ("<!DOCTYPE x:foo [<!ENTITY foo 'fooent'><!ENTITY bar 'test &foo;'>]><x:foo xmlns:x='hoge' />", XmlNodeType.Document, null);
34 document.Load (xtr);
35 xtr.Close ();
36 docType = document.DocumentType;
37 Assert.AreEqual (2, docType.Entities.Count);
38 XmlEntity foo = docType.Entities.Item (0) as XmlEntity;
39 XmlEntity bar = docType.Entities.Item (1) as XmlEntity;
40 Assert.AreEqual ("foo", foo.Name);
41 Assert.IsNull (bar.Value);
42 Assert.AreEqual (1, foo.ChildNodes.Count);
43 Assert.AreEqual ("bar", bar.Name);
44 Assert.IsNull (bar.Value);
45 Assert.AreEqual (1, foo.ChildNodes.Count);