Exemplo n.º 1
0
        // --------------------------------------------------------------------------------------------------------------
        //  CheckResult
        //  -------------------------------------------------------------------------------------------------------------
        public int CheckResult(double szExpResult)
        {
            double        checksumActual;
            CXsltChecksum check = new CXsltChecksum(_fTrace, _output);

            if (_nOutput == OutputType.URI)
            {
                checksumActual = check.Calc(xrXSLT);
            }
            else
            {
                checksumActual = check.Calc(_strOutFile);
            }

            if (szExpResult != checksumActual || _fTrace)
            {
                _output.WriteLine("XML: {0}", check.Xml);
                _output.WriteLine("Actual checksum: {0}, Expected: {1}", checksumActual, szExpResult);
            }
            if (szExpResult != checksumActual)
            {
                return(0);
            }

            return(1);
        }
Exemplo n.º 2
0
        public int CheckResult(string expResult)
        {
            double actChecksum, expChecksum;
            CXsltChecksum check = new CXsltChecksum(_fTrace, _output);

            // Let's make sure we use the same checksum calculating function for
            // actual and expected so we know we are comparing apples to apples.
            if (_nOutput == OutputType.URI)
            {
                expChecksum = check.Calc(XmlReader.Create(new StringReader(expResult)));
                actChecksum = check.Calc(xrXSLT);
            }
            else
            {
                using (StreamWriter sw = new StreamWriter(new FileStream(Path.Combine(Directory.GetCurrentDirectory(), "expectdchecksum.xml"), FileMode.Create, FileAccess.Write)))
                {
                    sw.Write(expResult);
                }
                expChecksum = check.Calc("expectdchecksum.xml");
                actChecksum = check.Calc(_strOutFile);
            }

            if (expChecksum != actChecksum || _fTrace)
            {
                _output.WriteLine("Act Xml: {0}", check.Xml);
                _output.WriteLine("Exp Xml: {0}", expResult);
                _output.WriteLine("Actual checksum: {0}, Expected: {1}", actChecksum, expChecksum);
            }

            if (expChecksum != actChecksum)
                return 0;

            return 1;
        }
Exemplo n.º 3
0
        // --------------------------------------------------------------------------------------------------------------
        //  CheckResult
        //  -------------------------------------------------------------------------------------------------------------
        public int CheckResult(double szExpResult)
        {
            lock (s_outFileMemoryLock)
            {
                double        checksumActual;
                CXsltChecksum check = new CXsltChecksum(_fTrace, _output);

                if (_nTransform == TransformType.Reader)
                {
                    checksumActual = check.Calc(xrXSLT);
                }
                else
                {
                    checksumActual = check.Calc(_strOutFile);
                }

                if (szExpResult != checksumActual || _fTrace)
                {
                    _output.WriteLine("XML: {0}", check.Xml);
                    _output.WriteLine("Actual checksum: {0}, Expected: {1}", checksumActual, szExpResult);
                }
                if (szExpResult != checksumActual)
                {
                    return(0);
                }

                return(1);
            }
        }
Exemplo n.º 4
0
        public int CheckResult(string expResult)
        {
            double actChecksum, expChecksum;
            CXsltChecksum check = new CXsltChecksum(_fTrace, _output);

            // Let's make sure we use the same checksum calculating function for
            // actual and expected so we know we are comparing apples to apples.
            if (_nOutput == OutputType.URI)
            {
                expChecksum = check.Calc(XmlReader.Create(new StringReader(expResult)));
                actChecksum = check.Calc(xrXSLT);
            }
            else
            {
                using (StreamWriter sw = new StreamWriter(new FileStream(Path.Combine(Directory.GetCurrentDirectory(), "expectdchecksum.xml"), FileMode.Create, FileAccess.Write)))
                {
                    sw.Write(expResult);
                }
                expChecksum = check.Calc("expectdchecksum.xml");
                actChecksum = check.Calc(_strOutFile);
            }

            if (expChecksum != actChecksum || _fTrace)
            {
                _output.WriteLine("Act Xml: {0}", check.Xml);
                _output.WriteLine("Exp Xml: {0}", expResult);
                _output.WriteLine("Actual checksum: {0}, Expected: {1}", actChecksum, expChecksum);
            }

            if (expChecksum != actChecksum)
                return 0;

            return 1;
        }
Exemplo n.º 5
0
        // --------------------------------------------------------------------------------------------------------------
        //  CheckResult
        //  -------------------------------------------------------------------------------------------------------------
        public int CheckResult(double szExpResult)
        {
            double checksumActual;
            CXsltChecksum check = new CXsltChecksum(_fTrace, _output);

            if (_nOutput == OutputType.URI)
                checksumActual = check.Calc(xrXSLT);
            else
                checksumActual = check.Calc(_strOutFile);

            if (szExpResult != checksumActual || _fTrace)
            {
                _output.WriteLine("XML: {0}", check.Xml);
                _output.WriteLine("Actual checksum: {0}, Expected: {1}", checksumActual, szExpResult);
            }
            if (szExpResult != checksumActual)
                return 0;

            return 1;
        }
Exemplo n.º 6
0
        // --------------------------------------------------------------------------------------------------------------
        //  CheckResult
        //  -------------------------------------------------------------------------------------------------------------
        public int CheckResult(double szExpResult)
        {
            lock (s_outFileMemoryLock)
            {
                double checksumActual;
                CXsltChecksum check = new CXsltChecksum(_fTrace, _output);

                if (_nTransform == TransformType.Reader)
                    checksumActual = check.Calc(xrXSLT);
                else
                    checksumActual = check.Calc(_strOutFile);

                if (szExpResult != checksumActual || _fTrace)
                {
                    _output.WriteLine("XML: {0}", check.Xml);
                    _output.WriteLine("Actual checksum: {0}, Expected: {1}", checksumActual, szExpResult);
                }
                if (szExpResult != checksumActual)
                    return 0;

                return 1;
            }
        }