summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId.Test/UI/TestSupportSanityTest.cs
blob: e84625b5949e42dcdaa206b12fd3035dbde4f610 (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
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.Net;
using System.Globalization;
using System.IO;
using System.Diagnostics;
using System.Text.RegularExpressions;

namespace DotNetOpenId.Test.UI {
	[TestFixture]
	public class TestSupportSanityTest {
		[Test]
		public void TestHost() {
			string query = "a=b&c=d";
			string body = "aa=bb&cc=dd";
			string resultHtml = UITestSupport.Host.ProcessRequest(TestSupport.HostTestPage + "?" + query, body);

			Assert.IsFalse(string.IsNullOrEmpty(resultHtml));
			Debug.WriteLine(resultHtml);
			Assert.IsTrue(Regex.IsMatch(resultHtml, @"Query.*" + Regex.Escape(query)));
			Assert.IsTrue(Regex.IsMatch(resultHtml, @"Body.*" + Regex.Escape(body)));
		}

		[Test]
		public void TestProviderPage() {
			string html = UITestSupport.Host.ProcessRequest(TestSupport.ProviderPage);
			Assert.IsFalse(string.IsNullOrEmpty(html));
		}
	}
}