Beispiel #1
0
        public void ShouldBeAbleToLoadXmlWithDTD()
        {
            tempfile = TempFileUtil.CreateTempFile("config", "project1.xml", @"<project name=""p1"" />");
            string xml =
                @"<!DOCTYPE cruisecontrol [ 
	<!ENTITY project1 SYSTEM ""file://"     + tempfile + @""">
]> 
<cruisecontrol>&project1;</cruisecontrol>";
            XmlTextReader       xr     = new XmlTextReader(new StringReader(xml));
            XmlValidatingLoader loader = new XmlValidatingLoader(xr);
            XmlDocument         doc    = loader.Load();

            Assert.IsNotNull(doc, "Unable to load document because it is not valid according to reader");
            IConfiguration config = new NetReflectorConfigurationReader().Read(doc, null);

            Assert.IsNotNull(config.Projects["p1"], "p1 should have been found");
        }
Beispiel #2
0
        public void SuccessfulLoad()
        {
            XmlValidatingLoader loader = XmlValidatingLoader(ConfigurationFixture.GenerateConfigXml());

            Assert.IsNotNull(loader.Load());
        }
Beispiel #3
0
        public void FailedLoad()
        {
            XmlValidatingLoader loader = XmlValidatingLoader(@"<cruisecontrol><projectx></projectx></cruisecontrol>");

            Assert.IsNull(loader.Load());
        }