Example #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);
        }
Example #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);
        }
Example #3
0
        public void ThrowExceptionWhenTransformationNotFound()
        {
            var newValidator = new XmlTransformationValidator();

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

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

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

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

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

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