summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/Hosting/HostingTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/Hosting/HostingTests.cs')
-rw-r--r--src/DotNetOpenAuth.Test/Hosting/HostingTests.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/Hosting/HostingTests.cs b/src/DotNetOpenAuth.Test/Hosting/HostingTests.cs
new file mode 100644
index 0000000..a9146ee
--- /dev/null
+++ b/src/DotNetOpenAuth.Test/Hosting/HostingTests.cs
@@ -0,0 +1,33 @@
+//-----------------------------------------------------------------------
+// <copyright file="HostingTests.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Test.Hosting {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Text;
+ using Microsoft.VisualStudio.TestTools.UnitTesting;
+ using System.Net;
+ using System.IO;
+ using DotNetOpenAuth.Test.OpenId;
+
+ [TestClass]
+ public class HostingTests {
+ [TestMethod]
+ public void AspHostBasicTest() {
+ using (AspNetHost host = AspNetHost.CreateHost(TestSupport.TestWebDirectory)) {
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(host.BaseUri);
+ using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
+ Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
+ using (StreamReader sr = new StreamReader(response.GetResponseStream())) {
+ string content = sr.ReadToEnd();
+ StringAssert.Contains(content, "Test home page");
+ }
+ }
+ }
+ }
+ }
+}