System.Xml.Tests.TCWriteAttributes.writeAttributes_13 C# (CSharp) Method

writeAttributes_13() public method

public writeAttributes_13 ( ) : int
return int
        public int writeAttributes_13()
        {
            string strxml = "<E a=\"&gt;&lt;&quot;&apos;&amp;\" />";
            using (XmlReader xr = CreateReader(new StringReader(strxml)))
            {
                xr.Read();
                xr.MoveToFirstAttribute();

                if (xr.NodeType != XmlNodeType.Attribute)
                {
                    CError.WriteLine("Reader positioned on {0}", xr.NodeType.ToString());
                    xr.Dispose();
                    return TEST_FAIL;
                }

                using (XmlWriter w = CreateWriter())
                {
                    w.WriteStartElement("Root");
                    w.WriteAttributes(xr, false);
                    w.WriteEndElement();
                }
            }
            return CompareReader("<Root a=\"&gt;&lt;&quot;&apos;&amp;\" />") ? TEST_PASS : TEST_FAIL;
        }