Exemplo n.º 1
0
        public void Validation()
        {
            XmlSchemaSet schemas = new XmlSchemaSet();

            schemas.XmlResolver = new ResourceResolver();
            schemas.Add(null, XmlReader.Create(new StringReader(OtaXsd.GetXsdText("OTA_HotelResRS"))));

            schemas.Compile();

            XDocument doc = XDocument.Parse(File.ReadAllText("OTA_HotelResRS.xml"));

            bool errors = false;

            doc.Validate(schemas, (sender, e) =>
            {
                Console.WriteLine(e.Message);
                errors = true;
            }, true);

            Assert.IsFalse(errors, "not validate");
        }
Exemplo n.º 2
0
        public void Exist(string name)
        {
            string xsdText = OtaXsd.GetXsdText(name);

            Assert.IsNotNullOrEmpty(xsdText);
        }