示例#1
0
        public void TestWithInvalidDocument()
        {
            //---------------Set up test pack-------------------
            XmlDocumentValidator validator = new XmlDocumentValidator();

            //---------------Execute Test ----------------------
            try
            {
                validator.ValidateDocument(itsXmlDocument.Replace("oneprop", "twoprop"), "test", itsDTD);
                Assert.Fail("Expected to throw an InvalidXmlDefinitionException");
            }
            //---------------Test Result -----------------------
            catch (InvalidXmlDefinitionException ex)
            {
                StringAssert.Contains("The relationship node does not conform to the dtd.The 'twoprop' element is not declared", ex.Message);
            }
        }
示例#2
0
        public void TestValidateDocument()
        {
            XmlDocumentValidator validator = new XmlDocumentValidator();

            validator.ValidateDocument(itsXmlDocument, "test", itsDTD);
        }