System.Xml.Tests.TCFullEndElement.TCWriteValue.VerifyValue C# (CSharp) Method

VerifyValue() public method

public VerifyValue ( Type dest, object expVal, int param ) : void
dest Type
expVal object
param int
return void
            public void VerifyValue(Type dest, object expVal, int param)
            {
                object actual;

                using (Stream fsr = FilePathUtil.getStream("writer.out"))
                {
                    using (XmlReader r = ReaderHelper.Create(fsr))
                    {
                        while (r.Read())
                        {
                            if (r.NodeType == XmlNodeType.Element)
                                break;
                        }
                        if (param == 1)
                        {
                            actual = (object)r.ReadElementContentAs(dest, null);
                            if (!actual.Equals(expVal)) CError.Compare(actual.ToString(), expVal.ToString(), "RECA");
                        }
                        else
                        {
                            r.MoveToAttribute("a");
                            actual = (object)r.ReadContentAs(dest, null);
                            if (!actual.Equals(expVal)) CError.Compare(actual.ToString(), expVal.ToString(), "RCA");
                        }
                    }
                }
            }