Example #1
0
        public bool CompareReader(XmlReader xrExpected, XmlDiffOption option)
        {
            bool bReturn = false;

            XmlReader xrActual = GetReader();

            XmlDiff diff = new XmlDiff();

            diff.Option = option;

            try
            {
                bReturn = diff.Compare(xrExpected, xrActual);
            }
            catch (Exception e)
            {
                CError.WriteLine(e);
            }
            finally
            {
                xrActual.Dispose();
                xrExpected.Dispose();
            }
            if (!bReturn)
            {
                CError.WriteLine("Mismatch in XmlDiff");
                CError.WriteLine("Actual o/p:");
                CError.WriteLine(this.GetString());
            }

            return(bReturn);
        }
Example #2
0
 public XmlDiff()
 {
     _XmlDiffOption = XmlDiffOption.IgnoreEmptyElement |
                      XmlDiffOption.IgnoreWhitespace |
                      XmlDiffOption.IgnoreAttributeOrder |
                      XmlDiffOption.IgnoreNS |
                      XmlDiffOption.IgnorePrefix |
                      XmlDiffOption.IgnoreDTD |
                      XmlDiffOption.IgnoreChildOrder;
 }
Example #3
0
        public bool CompareReader(XmlReader xrExpected, XmlDiffOption option)
        {
            bool bReturn = false;

            XmlReader xrActual = GetReader();

            XmlDiff diff = new XmlDiff();
            diff.Option = option;

            try
            {
                bReturn = diff.Compare(xrExpected, xrActual);
            }
            catch (Exception e)
            {
                CError.WriteLine(e);
            }
            finally
            {
                xrActual.Dispose();
                xrExpected.Dispose();
            }
            if (!bReturn)
            {
                CError.WriteLine("Mismatch in XmlDiff");
                CError.WriteLine("Actual o/p:");
                CError.WriteLine(this.GetString());
            }

            return bReturn;
        }