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

writeAttributes_3() public method

public writeAttributes_3 ( ) : int
return int
        public int writeAttributes_3()
        {
            using (XmlWriter w = CreateWriter())
            {
                XmlReader xr = null;
                try
                {
                    w.WriteStartElement("Root");
                    w.WriteAttributes(xr, false);
                }
                catch (ArgumentNullException e)
                {
                    CError.WriteLineIgnore("Exception: " + e.ToString());
                    CError.Compare(w.WriteState, WriteState.Element, "WriteState should be Element");
                    return TEST_PASS;
                }
            }
            CError.WriteLine("Did not throw exception");
            return TEST_FAIL;
        }