Esempio n. 1
0
        public void ValidateCustomDbSchemaTest()
        {
            var doc       = XDocument.Load("TestCustomDbSchema.xml");
            var dbManager = new HyperDbXmlScriptProvider();

            dbManager.ClearDbXmlSchemas();
            dbManager.AddDbXmlSchema(null, "TestCustomDbXmlSchema.xsd");
            dbManager.ValidateDbXmlDocument(doc, null, false);
        }
Esempio n. 2
0
        public void ValidateHyperAgainstCustomDbSchemaTest()
        {
            Exception testEx = null;

            try
            {
                var doc       = XDocument.Load("TestHyperDbSchema.xml");
                var dbManager = new HyperDbXmlScriptProvider();
                dbManager.ClearDbXmlSchemas();
                dbManager.AddDbXmlSchema(null, "TestCustomDbXmlSchema.xsd");
                dbManager.ValidateDbXmlDocument(doc, null, false);
            }
            catch (Exception ex)
            {
                testEx = ex;
            }

            // If the expected exception was thrown, the test was successful
            Assert.IsNotNull(testEx);
            Assert.IsTrue(testEx is XmlSchemaValidationException);
        }