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

writeAttributes_1() public method

public writeAttributes_1 ( ) : int
return int
        public int writeAttributes_1()
        {
            using (XmlWriter w = CreateWriter())
            {
                using (XmlReader xr = CreateReader("XmlReader.xml"))
                {
                    while (xr.Read())
                    {
                        if (xr.LocalName == "name")
                        {
                            xr.MoveToFirstAttribute();
                            break;
                        }
                    }
                    w.WriteStartElement("Root");
                    w.WriteAttributes(xr, true);
                    w.WriteEndElement();
                }
            }
            return CompareReader("<Root a=\"b\" FIRST=\"KEVIN\" LAST=\"WHITE\" />") ? TEST_PASS : TEST_FAIL;
        }