diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/Hosting')
-rw-r--r-- | src/DotNetOpenAuth.Test/Hosting/HostingTests.cs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth.Test/Hosting/HostingTests.cs b/src/DotNetOpenAuth.Test/Hosting/HostingTests.cs index d7de7a1..4e0f618 100644 --- a/src/DotNetOpenAuth.Test/Hosting/HostingTests.cs +++ b/src/DotNetOpenAuth.Test/Hosting/HostingTests.cs @@ -12,11 +12,11 @@ namespace DotNetOpenAuth.Test.Hosting { using System.Net; using System.Text; using DotNetOpenAuth.Test.OpenId; - using Microsoft.VisualStudio.TestTools.UnitTesting; + using NUnit.Framework; - [TestClass] + [TestFixture, Category("HostASPNET")] public class HostingTests : TestBase { - [TestMethod] + [TestCase] public void AspHostBasicTest() { try { using (AspNetHost host = AspNetHost.CreateHost(TestWebDirectory)) { @@ -25,12 +25,21 @@ namespace DotNetOpenAuth.Test.Hosting { Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); using (StreamReader sr = new StreamReader(response.GetResponseStream())) { string content = sr.ReadToEnd(); - StringAssert.Contains(content, "Test home page"); + StringAssert.Contains("Test home page", content); } } } } catch (FileNotFoundException ex) { - Assert.Inconclusive("Unable to execute hosted ASP.NET tests because {0} could not be found. {1}", ex.FileName, ex.FusionLog); + Assert.Inconclusive( + "Unable to execute hosted ASP.NET tests because {0} could not be found. {1}", ex.FileName, ex.FusionLog); + } catch (WebException ex) { + if (ex.Response != null) { + using (var responseStream = new StreamReader(ex.Response.GetResponseStream())) { + Console.WriteLine(responseStream.ReadToEnd()); + } + } + + throw; } } } |