Exemplo n.º 1
0
        public void GetDtdValidatorTest1()
        {
            SerializeTool serialize = new SerializeTool("testObjectToValidate.xml");
            var           validator = serialize.GetDtdValidator();

            Assert.IsNotNull(validator);
            if (validator.Validate())
            {
                Debug.Print("OK");
            }
            else
            {
                string message = "";
                foreach (ValidationErrorInfo validatorLastException in validator.LastExceptions)
                {
                    message += "\n";
                    message += $"{validatorLastException.Message} (row/col)=>{validatorLastException.LineNumber}/{validatorLastException.LinePosition}";
                }

                Assert.Fail(message);
            }
        }