diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2015-02-04 07:56:29 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2015-02-20 22:31:39 +0300 |
commit | 923ed6b24174eb5d87390fad0993306133213227 (patch) | |
tree | d629cd1cccfccedec1746b7084319ef23035b242 /mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs | |
parent | d9184320f78b7a4fa4ea064993721dd4e20dfa44 (diff) |
[Sys.Security] don't expect XmlNode.ChildNodes returns the same instance.
It did in mono implementation. It doesn't on referencesource.
Diffstat (limited to 'mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs')
-rw-r--r-- | mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs index cc44b12d4c5..03b4f215b84 100644 --- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigXsltTransformTest.cs @@ -10,6 +10,7 @@ // using System; +using System.Collections; using System.IO; using System.Security.Cryptography; using System.Security.Cryptography.Xml; @@ -243,7 +244,19 @@ namespace MonoTests.System.Security.Cryptography.Xml { XmlDocument doc = GetXslDoc (); transform.LoadInnerXml (doc.DocumentElement.ChildNodes); XmlNodeList xnl = transform.UnprotectedGetInnerXml (); - Assert.AreEqual (doc.DocumentElement.ChildNodes, xnl, "LoadInnerXml"); + AssertNodeListEqual (doc.DocumentElement.ChildNodes, xnl, "LoadInnerXml"); + } + + void AssertNodeListEqual (XmlNodeList nl1, XmlNodeList nl2, string label) + { + Assert.AreEqual (nl1.Count, nl2.Count, label + ": node count"); + IEnumerator e1, e2; + int i; + for (i = 0, e1 = nl1.GetEnumerator (), e2 = nl2.GetEnumerator (); e1.MoveNext (); i++) { + Assert.IsTrue (e2.MoveNext (), label + " : nl2.MoveNext"); + Assert.AreEqual (e1.Current, e2.Current, label + " : node at " + i); + } + Assert.IsFalse (e2.MoveNext (), label + " : nl2 has extras"); } [Test] |