System.Xml.Tests.TCAutoComplete.var_4 C# (CSharp) Method

var_4() public method

public var_4 ( ) : int
return int
        public int var_4()
        {
            using (XmlWriter w = CreateWriter())
            {
                try
                {
                    w.WriteStartDocument();
                    w.WriteEndDocument();
                }
                catch (ArgumentException e)
                {
                    CError.WriteLineIgnore("Exception: " + e.ToString());

                    return TEST_FAIL;
                }
                catch (InvalidOperationException e)
                {
                    CError.WriteLineIgnore("Exception: " + e.ToString());
                    CError.Compare(w.WriteState, WriteState.Error, "WriteState should be Error");
                    return TEST_PASS;
                }
            }
            CError.WriteLine("Did not throw exception");
            return TEST_FAIL;
        }