comparison Xml/XmlResourceResolverTests.cs @ 48:1e731dda7608

Re #49: XmlResourceResolver fails with HTML DTD on Windows * Make absolute URI mapping test URI resolving
author IBBoard <dev@ibboard.co.uk>
date Sat, 01 Sep 2012 14:17:09 +0100
parents 66eee91f51b3
children 99e4c1949c92
comparison
equal deleted inserted replaced
47:66eee91f51b3 48:1e731dda7608
18 Assembly localAssembly = Assembly.GetExecutingAssembly(); 18 Assembly localAssembly = Assembly.GetExecutingAssembly();
19 XmlResourceResolver resolver = new XmlResourceResolver(localAssembly); 19 XmlResourceResolver resolver = new XmlResourceResolver(localAssembly);
20 string uriString = "http://ibboard.co.uk/some.xsd"; 20 string uriString = "http://ibboard.co.uk/some.xsd";
21 string resourceID = "IBBoard.test-data.ResourceResolver.some.xsd"; 21 string resourceID = "IBBoard.test-data.ResourceResolver.some.xsd";
22 resolver.AddMapping(uriString, resourceID); 22 resolver.AddMapping(uriString, resourceID);
23 Assert.That(resolver.ResolveUri(null, uriString), Is.EqualTo(new Uri(uriString)));
23 Stream resolvedStream = (Stream)resolver.GetEntity(new Uri(uriString), null, typeof(Stream)); 24 Stream resolvedStream = (Stream)resolver.GetEntity(new Uri(uriString), null, typeof(Stream));
24 Assert.That(resolvedStream, Is.EqualTo(localAssembly.GetManifestResourceStream(resourceID))); 25 Assert.That(resolvedStream, Is.EqualTo(localAssembly.GetManifestResourceStream(resourceID)));
25 } 26 }
26 27
27 [Test()] 28 [Test()]