diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-08-08 15:46:40 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2008-08-08 15:46:40 -0700 |
commit | 3fb65cccfa1e35de45b3b42cf0f7867b77dca254 (patch) | |
tree | 47b16124b0a19aa0e27662f24b9e41a891cf7ee0 /src/DotNetOpenId.Test/UI/IdentityEndpointTest.cs | |
parent | 47e9212eebc0bc4d002ce1822e0b2959bd14e244 (diff) | |
download | DotNetOpenAuth-3fb65cccfa1e35de45b3b42cf0f7867b77dca254.zip DotNetOpenAuth-3fb65cccfa1e35de45b3b42cf0f7867b77dca254.tar.gz DotNetOpenAuth-3fb65cccfa1e35de45b3b42cf0f7867b77dca254.tar.bz2 |
Put all ASP.NET depending tests inside a UI directory.
Diffstat (limited to 'src/DotNetOpenId.Test/UI/IdentityEndpointTest.cs')
-rw-r--r-- | src/DotNetOpenId.Test/UI/IdentityEndpointTest.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/DotNetOpenId.Test/UI/IdentityEndpointTest.cs b/src/DotNetOpenId.Test/UI/IdentityEndpointTest.cs new file mode 100644 index 0000000..87dddb4 --- /dev/null +++ b/src/DotNetOpenId.Test/UI/IdentityEndpointTest.cs @@ -0,0 +1,41 @@ +using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using System.IO;
+using System.Diagnostics;
+using DotNetOpenId.Test.Hosting;
+using System.Text.RegularExpressions;
+using System.Net;
+using System.Globalization;
+
+namespace DotNetOpenId.Test.UI {
+ [TestFixture]
+ public class IdentityEndpointTest {
+ void parameterizedIdentityEndpointPage(ProtocolVersion version) {
+ Protocol protocol = Protocol.Lookup(version);
+ TestSupport.Scenarios scenario = TestSupport.Scenarios.AutoApproval;
+ Identifier identityUrl = TestSupport.GetIdentityUrl(scenario, version);
+ string html = TestSupport.Host.ProcessRequest(identityUrl);
+ Trace.TraceInformation("{0} response:{1}{2}", identityUrl, Environment.NewLine, html);
+ Assert.IsTrue(Regex.IsMatch(html, string.Format(CultureInfo.InvariantCulture,
+ @"\<link rel=""{1}"" href=""http://[^/]+/{0}""\>\</link\>",
+ Regex.Escape(TestSupport.ProviderPage),
+ Regex.Escape(protocol.HtmlDiscoveryProviderKey))));
+ Assert.IsTrue(Regex.IsMatch(html, string.Format(CultureInfo.InvariantCulture,
+ @"\<link rel=""{1}"" href=""http://[^/]+{0}""\>\</link\>",
+ Regex.Escape(new Uri(TestSupport.GetDelegateUrl(scenario).ToString()).AbsolutePath),
+ Regex.Escape(protocol.HtmlDiscoveryLocalIdKey))));
+ }
+
+ [Test]
+ public void IdentityEndpoint20Page() {
+ parameterizedIdentityEndpointPage(ProtocolVersion.V20);
+ }
+
+ [Test]
+ public void IdentityEndpoint11Page() {
+ parameterizedIdentityEndpointPage(ProtocolVersion.V11);
+ }
+ }
+}
|