Ejemplo n.º 1
0
        private void Transform_TestRunner_ExpectFail(string source, string transform, string expectedLog)
        {
            string src           = CreateATestFile("source.config", source);
            string transformFile = CreateATestFile("transform.config", transform);
            XmlTransformationValidator validator = new XmlTransformationValidator();

            bool succeed = validator.Validate(src, transformFile, false);

            //test
            Assert.AreEqual(false, succeed);
            CompareMultiLines(expectedLog, validator.VerboseLog);
        }
Ejemplo n.º 2
0
        public void Validation_ErrorAndWarning_DualLogs()
        {
            Transform_TestRunner_ExpectFail(Properties.Resources.WarningsAndErrors_source, Properties.Resources.WarningsAndErrors_transform, Properties.Resources.WarningsAndErrors);

            string src           = CreateATestFile("source.config", Properties.Resources.WarningsAndErrors_source);
            string transformFile = CreateATestFile("transform.config", Properties.Resources.WarningsAndErrors_transform);
            XmlTransformationValidator validator = new XmlTransformationValidator();

            bool succeed = validator.Validate(src, transformFile, false);

            //test
            Assert.AreEqual(false, succeed);
            Assert.AreNotEqual(validator.ErrorLog, string.Empty);
            Assert.AreNotEqual(validator.WarningLog, string.Empty);
        }
Ejemplo n.º 3
0
        public void ThrowExceptionWhenTransformationNotFound()
        {
            var newValidator = new XmlTransformationValidator();

            newValidator.Validate("test", "test");
        }
Ejemplo n.º 4
0
        public void ThrowExceptionWhenSourceNotFound()
        {
            var newValidator = new XmlTransformationValidator();

            newValidator.Validate("test", string.Empty);
        }
Ejemplo n.º 5
0
        public void ThrowExceptionWhenTransformationIsEmpty()
        {
            var newValidator = new XmlTransformationValidator();

            newValidator.Validate("test", string.Empty);
        }
Ejemplo n.º 6
0
        public void ThrowExceptionWhenTransformationIsNull()
        {
            var newValidator = new XmlTransformationValidator();

            newValidator.Validate("test", null);
        }
Ejemplo n.º 7
0
        public void ThrowExceptionWhenSourceIsEmpty()
        {
            var newValidator = new XmlTransformationValidator();

            newValidator.Validate(string.Empty, "test");
        }
Ejemplo n.º 8
0
        public void ThrowExceptionWhenSourceIsNull()
        {
            var newValidator = new XmlTransformationValidator();

            newValidator.Validate(null, "test");
        }