public static RegisterParser ( INamespaceParser parser ) : void | ||
parser | INamespaceParser | /// The parser instance. /// |
리턴 | void |
public void CanLoadSchemaImportingOtherSchemaByRelativePath() { string schemaLocation = TestResourceLoader.GetAssemblyResourceUri(this.GetType(), "NamespaceParserRegistryTests_TestSchema.xsd"); NamespaceParserRegistry.RegisterParser(new TestNamespaceParser(), "http://www.example.com/brief", schemaLocation); XmlReader vr = XmlUtils.CreateValidatingReader(new StringResource( @"<?xml version='1.0' encoding='UTF-8' ?> <brief class='foo' /> ").InputStream, NamespaceParserRegistry.GetSchemas(), null); ConfigXmlDocument newDoc = new ConfigXmlDocument(); newDoc.Load(vr); }
public void RegisterParserWithEmptyNamespaceWithoutDefaultValues() { NamespaceParserRegistry.RegisterParser( typeof(NotImplementedXmlObjectDefinitionParser), string.Empty, null); }
public void RegisterParserWithBadParserType() { NamespaceParserRegistry.RegisterParser(GetType()); }
public void RegisterParserWithNullType() { NamespaceParserRegistry.RegisterParser((Type)null); }
public void RegisterParserWithEmptyNamespaceWithoutDefaultValues() { Assert.Throws <ArgumentNullException>(() => NamespaceParserRegistry.RegisterParser(typeof(NotImplementedXmlObjectDefinitionParser), string.Empty, null)); }
public void RegisterParserWithBadParserType() { Assert.Throws <ArgumentException>(() => NamespaceParserRegistry.RegisterParser(GetType())); }
public void RegisterParserWithNullType() { Assert.Throws <ArgumentNullException>(() => NamespaceParserRegistry.RegisterParser((Type)null)); }