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

writeAttributes_6() public method

public writeAttributes_6 ( ) : int
return int
        public int writeAttributes_6()
        {
            using (XmlWriter w = CreateWriter())
            {
                using (XmlReader xr = CreateReader("XmlReader.xml"))
                {
                    while (xr.Read())
                    {
                        if (xr.LocalName == "AttributesGeneric")
                        {
                            do { xr.Read(); } while (xr.LocalName != "node");
                            xr.MoveToNextAttribute();
                            xr.MoveToNextAttribute();
                            xr.MoveToNextAttribute();
                            break;
                        }
                    }
                    if (xr.NodeType != XmlNodeType.Attribute)
                    {
                        CError.WriteLine("Reader not positioned on attribute");
                        CError.WriteLine(xr.LocalName);
                        xr.Dispose();
                        w.Dispose();
                        return TEST_FAIL;
                    }
                    w.WriteStartElement("Root");
                    w.WriteAttributes(xr, false);
                    w.WriteEndElement();
                }
            }
            return CompareReader("<Root e=\"f\" />") ? TEST_PASS : TEST_FAIL;
        }