# HG changeset patch # User IBBoard # Date 1346441969 -3600 # Node ID 179c4cf6aecf116fe88f8865f073cd27c9551b74 # Parent 7502653a71a09601be5041c5e0378075d9efe665 Re #49: XmlResourceResolver fails with HTML DTD on Windows * Add test for resolver using standard URIs diff -r 7502653a71a0 -r 179c4cf6aecf IBBoard.Tests.csproj --- a/IBBoard.Tests.csproj Sun Jun 24 15:50:45 2012 +0100 +++ b/IBBoard.Tests.csproj Fri Aug 31 20:39:29 2012 +0100 @@ -31,9 +31,9 @@ v2.0 - true + True full - false + False bin\Debug DEBUG prompt @@ -42,7 +42,7 @@ none - false + False bin\Release prompt 4 @@ -72,6 +72,7 @@ + @@ -81,38 +82,6 @@ False - - - False - .NET Framework Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - false - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - @@ -134,27 +103,33 @@ - false + False PreserveNewest - false + False PreserveNewest - false + False PreserveNewest - false + False PreserveNewest - false + False PreserveNewest PreserveNewest + + + + + + \ No newline at end of file diff -r 7502653a71a0 -r 179c4cf6aecf Xml/XmlResourceResolverTests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Xml/XmlResourceResolverTests.cs Fri Aug 31 20:39:29 2012 +0100 @@ -0,0 +1,28 @@ +// This file (XmlResourceResolverTests.cs) is a part of the IBBoard.Tests project and is copyright 2012 IBBoard +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU LGPL, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. +using System; +using NUnit.Framework; +using System.Reflection; +using System.IO; +using NUnit.Framework.SyntaxHelpers; + +namespace IBBoard.Xml +{ + [TestFixture()] + public class XmlResourceResolverTests + { + [Test()] + public void TestGettingStreamForAddedResource() + { + Assembly localAssembly = Assembly.GetExecutingAssembly(); + XmlResourceResolver resolver = new XmlResourceResolver(localAssembly); + string uriString = "http://ibboard.co.uk/some.xsd"; + string resourceID = "IBBoard.test-data.ResourceResolver.some.xsd"; + resolver.AddMapping(uriString, resourceID); + Stream resolvedStream = (Stream)resolver.GetEntity(new Uri(uriString), null, typeof(Stream)); + Assert.That(resolvedStream, Is.EqualTo(localAssembly.GetManifestResourceStream(resourceID))); + } + } +} + diff -r 7502653a71a0 -r 179c4cf6aecf test-data/ResourceResolver/some.xsd