public void ParseSectionWithNoChildParserNamespaceElements() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <!-- now't in here --> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); handler.Create(null, null, BuildConfigurationSection(xml)); }
public void ParseSectionWithBadTypeForHandler() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <parser namespace='http://schemas.springframework.net/2' type='Rubbish' schemaLocation='assembly://Spring.Core.Tests/Spring.Context.Support/testobject.xsd'/> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); handler.Create(null, null, BuildConfigurationSection(xml)); }
public void ParseSectionWithHandlerThatDoesNotImplement_IXmlObjectDefinitionParser() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <parser namespace='http://schemas.springframework.net/2' type='Spring.Context.Support.NamespaceParsersSectionHandlerTests, Spring.Core.Tests' schemaLocation='assembly://Spring.Core.Tests/Spring.Context.Support/testobject.xsd'/> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); handler.Create(null, null, BuildConfigurationSection(xml)); }
public void ParseSectionWithEmptyType() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <parser namespace='http://schemas.springframework.net/3' type='' schemaLocation='assembly://Spring.Core.Tests/Spring.Context.Support/testobject.xsd'/> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); handler.Create(null, null, BuildConfigurationSection(xml)); }
public void ParseSectionWithNoChildParserNamespaceElements() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <!-- now't in here --> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); handler.Create(null, null, BuildConfigurationSection(xml)); }
public void ParseSectionWithHandlerThatDoesNotImplement_IXmlObjectDefinitionParser() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <parser namespace='http://schemas.springframework.net/2' type='Spring.Context.Support.NamespaceParsersSectionHandlerTests, Spring.Core.Tests' schemaLocation='assembly://Spring.Core.Tests/Spring.Context.Support/testobject.xsd'/> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); handler.Create(null, null, BuildConfigurationSection(xml)); }
public void WithParserElementThatIsMissingTheTypeAttribute() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <parser namespace='http://schemas.springframework.net/3'/> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); handler.Create(null, null, BuildConfigurationSection(xml)); }
public void ParseSectionWithBadTypeForHandler() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <parser namespace='http://schemas.springframework.net/2' type='Rubbish' schemaLocation='assembly://Spring.Core.Tests/Spring.Context.Support/testobject.xsd'/> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); Assert.Throws <TypeLoadException>(() => handler.Create(null, null, BuildConfigurationSection(xml))); }
public void WithParserElementThatIsMissingTheTypeAttribute() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <parser namespace='http://schemas.springframework.net/3'/> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); handler.Create(null, null, BuildConfigurationSection(xml)); }
public void ParseSectionWithEmptyType() { const string xml = @"<?xml version='1.0' encoding='UTF-8' ?> <parsers> <parser namespace='http://schemas.springframework.net/3' type='' schemaLocation='assembly://Spring.Core.Tests/Spring.Context.Support/testobject.xsd'/> </parsers>"; NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler(); Assert.Throws<ArgumentNullException>(() => handler.Create(null, null, BuildConfigurationSection(xml))); }