summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId.Test/UI/ProviderEndpointTest.cs
blob: 6da933ab771cd647cf1af3990b6e19f25c0d405e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using DotNetOpenId.Test.Hosting;
using DotNetOpenId.Provider;
using System.Net;

namespace DotNetOpenId.Test.UI {
	[TestFixture]
	public class ProviderEndpointTest {
		[Test]
		public void Ctor() {
			ProviderEndpoint pe = new ProviderEndpoint();
		}

		[Test]
		public void SimpleEnabled() {
			ProviderEndpoint pe = new ProviderEndpoint();
			Assert.IsTrue(pe.Enabled);
			pe.Enabled = false;
			Assert.IsFalse(pe.Enabled);
		}

		[Test]
		public void OrdinaryHTTPRequest() {
			Uri pe = TestSupport.GetFullUrl(TestSupport.ProviderPage);
			HttpWebRequest req = (HttpWebRequest)WebRequest.Create(pe);
			req.AllowAutoRedirect = false;
			HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
			Assert.AreEqual(HttpStatusCode.OK, resp.StatusCode);
			Assert.AreEqual("text/html; charset=utf-8", resp.ContentType);
		}

		// Most other scenarios for the endpoint control are tested by our 
		// end-to-end testing.
	}
}