Exemplo n.º 1
0
		public void CapabilitiesUsedBySystemWebIE6 () 
		{
			WebTest t = new WebTest (PageInvoker.CreateOnLoad (CapabilitiesUsedBySystemWebIE6_OnLoad));
			// Set UserAgent string to IE6
			t.Request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)";
			t.Run ();
		}
Exemplo n.º 2
0
		public void CapabilitiesUsedBySystemWebIE7 () 
		{
			WebTest t = new WebTest (PageInvoker.CreateOnLoad (CapabilitiesUsedBySystemWebIE7_OnLoad));
			// Set UserAgent string to IE7
			t.Request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
			t.Run ();
		}
Exemplo n.º 3
0
		public void CrossPagePosting_BaseFixture ()
		{
			WebTest t = new WebTest ("CrossPagePosting1.aspx");
			string html = t.Run ();

			if (html.IndexOf ("LinkButtonText") < 0)
				Assert.Fail ("Link button not created fail");

			PageDelegates pd = new PageDelegates ();
			pd.Load = Load;
			t.Invoker = new PageInvoker (pd);

			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			
			fr.Controls["__EVENTTARGET"].Value = "LinkButton1";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			
			t.Request = fr;
			fr.Url = "CrossPagePosting2.aspx";
			html = t.Run ();
			if (html.IndexOf ("CrossedPostbackPage") < 0)
				Assert.Fail ("CrossPagePosting removeing to target page fail");
		}
		public void StateFormatter_CollectionFormatter ()
		{
			WebTest t = new WebTest ("StateFormatter_CollectionConverter.aspx");
			t.Run ();

			var fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("btnSearch");
			fr.Controls.Add ("ddlDate");
			fr.Controls.Add ("txtSearchValue");

			fr.Controls ["btnSearch"].Value = "Search";
			fr.Controls ["ddlDate"].Value = "2009";

			t.Request = fr;
			string pageHtml = t.Run ();
			string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
			string originalHtml = @"<div>

		<table id=""gvECCN"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
				<tr>
					<th align=""left"" scope=""col"">&nbsp;</th><th align=""left"" scope=""col"">Schedule B</th><th align=""left"" scope=""col"">Count</th><th align=""left"" scope=""col"">Total</th><th align=""left"" scope=""col"">Percent</th>
				</tr><tr>
					<td style=""height:18px;width:30px;"">1</td><td style=""width:140px;"">test</td><td style=""width:90px;"">1</td><td style=""width:100px;"">100</td><td style=""width:90px;"">250.00 %</td>

				</tr>
			</table>
		</div>";

			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
		}
Exemplo n.º 5
0
		public void TestStyle ()
		{
			string res = new WebTest (PageInvoker.CreateOnLoad (
				new PageDelegate(_TestStyle))).Run ();
			Assert.IsNotNull (res);
			Assert.IsTrue (res != string.Empty);
		}
Exemplo n.º 6
0
		public void RenderSiteMapPathProp ()
		{
			PageInvoker pi = PageInvoker.CreateOnLoad (_RenderSiteMapPathProp);
			string res = new WebTest (pi).Run ();
			Console.WriteLine (res);
			Assert.IsFalse (string.IsNullOrEmpty (res));
		}
		public void GetAppSetting1 ()
		{
			PageDelegates pd = new PageDelegates ();
			pd.Load = GetAppSetting1_Load;
			WebTest test = new WebTest (new PageInvoker (pd));
			test.Run ();
		}
Exemplo n.º 8
0
		public void MappingUrl()
		{
			WebTest t = new WebTest ("Mapping.aspx");
			string result = t.Run ();
			if (result.IndexOf ("Default from mapping") < 0)
				Assert.Fail ("Mapping URL Fail");
		}
Exemplo n.º 9
0
		public void GlobalResourcesLocalization ()
		{
			string pageHtml = new WebTest ("GlobalResourcesLocalization.aspx").Run ();
                        string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
                        string originalHtml = "<input type=\"submit\" name=\"button1\" value=\"Recharger\" id=\"button1\" />";
                        
                        HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
		}
Exemplo n.º 10
0
		public void HtmlTitleCodeRender_Bug662918 ()
		{
			string origHtml = "<head><title>\r\n\tTitle text\r\n</title></head>";
			string pageHtml = new WebTest ("HtmlTitleCodeRender_Bug662918.aspx").Run ();
			string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);

			HtmlDiff.AssertAreEqual (origHtml, renderedHtml, "#A1");
		}
Exemplo n.º 11
0
		public void TestMasterPage ()
		{
			PageInvoker pi = PageInvoker.CreateOnLoad (_TestMasterPage);
			WebTest t = new WebTest (pi);
			t.Request.Url = StandardUrl.PAGE_WITH_MASTER;
			string res = t.Run ();
			Console.WriteLine (res);
			Assert.IsFalse (string.IsNullOrEmpty (res));
		}
		public void HostedDefaultValues () 
		{
			StaticDefaultValues ("Before:");

			WebTest t = new WebTest (PageInvoker.CreateOnLoad (HostedDefaultValues_OnLoad));
			t.Run ();
			Assert.AreEqual (global::System.Net.HttpStatusCode.OK, t.Response.StatusCode, "HttpStatusCode");

			StaticDefaultValues ("After:");
		}
Exemplo n.º 13
0
		public WebTest Run (WebTest t)
		{
			NameValueCollection headers = new NameValueCollection ();
			headers.Add (INVOKER_HEADER, Serialize (t.Invoker));
			headers.Add (USER_HEADER, Serialize (t.UserData));
			WebRequest wr = t.Request.CreateWebRequest (
#if TARGET_JVM
				new Uri ("http://localhost:8080/MainsoftWebApp20/"),
#else
new Uri ("http://localhost:59598/NunitWebTest/"),
#endif
				headers);


			WebResponse response = null;
			try {
				
				response = wr.GetResponse ();
				HttpStatusCode status = ((HttpWebResponse) response).StatusCode;
				if (status != HttpStatusCode.OK && status != HttpStatusCode.Found)
					throw new WebException (((HttpWebResponse) response).StatusCode.ToString ());

				t.Response = t.Request.ExtractResponse (response);
				string etype = response.Headers [EXCEPTION_HEADER];

				if (!String.IsNullOrEmpty (etype)) {
					Exception e;
					string data = t.Response.Body;
					int start = data.IndexOf (EXCEPTION_HEADER);
					if (start >= 0) {
						start += EXCEPTION_HEADER.Length;
						int end = data.IndexOf (EXCEPTION_HEADER, start);
						int length = int.Parse(data.Substring(start, end - start));

						string serialized = data.Substring (end + EXCEPTION_HEADER.Length, length);
						e = (Exception) DeserializeBinary (serialized);
					}
					else
						e = (Exception) Activator.CreateInstance (Type.GetType(etype));

					if (e != null)
						RethrowException (e);
				}


				t.UserData = Deserialize (response.Headers [USER_HEADER]);
			}
			finally {
				if (response != null)
					response.Close ();
			}

			return t;
		}
Exemplo n.º 14
0
		public WebTest Run (WebTest t)
		{
			_currentTest = t;
			_doNext.Set ();
			_done.WaitOne ();
			if (_e != null) {
				Exception e = _e;
				_e = null;
				throw e;
			}
			return t;
		}
Exemplo n.º 15
0
		public WebTest Run (WebTest t)
		{
			HttpWorkerRequest wr = t.Request.CreateWorkerRequest ();
			MyData data = GetMyData (wr);
			data.currentTest = t;
			data.exception = null;

			HttpRuntime.ProcessRequest (wr);
			t.Response = t.Request.ExtractResponse (wr);
			
			if (data.exception != null)
				RethrowException (data.exception);
			
			return t;
		}
		public void StateFormatter_CorrectConverter ()
		{
			// We test only if it doesn't throw exception on postback
			WebTest t = new WebTest ("StateFormatter_CorrectConverter.aspx");
			t.Run ();

			var fr = new FormRequest (t.Response, "Form1");
			fr.Controls.Add ("Button1");
			fr.Controls ["Button1"].Value = "Change";
			t.Request = fr;
			t.Run ();

			fr = new FormRequest (t.Response, "Form1");
			fr.Controls.Add ("Button2");
			fr.Controls ["Button2"].Value = "Refresh";
		}
Exemplo n.º 17
0
		[Category ("NotDotNet")] // for dot-net use __CALLBACKID insted __CALLBACKTARGET and __CALLBACKARGUMENT insted __CALLBACKPARAM
		public void CallBackResulrValues ()
		{
			WebTest t = new WebTest ("CallbackTest1.aspx");
			string html = t.Run ();
			PageDelegates pd = new PageDelegates ();
			pd.Load = Load;
			t.Invoker = new PageInvoker (pd);

			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls.Add ("__CALLBACKTARGET");
			fr.Controls.Add ("__CALLBACKARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			fr.Controls ["__CALLBACKTARGET"].Value = "__Page";
			fr.Controls ["__CALLBACKARGUMENT"].Value = "monitor";

			t.Request = fr;
			html = t.Run ();
			
			// Into result string the last 2 variables shows if events been done
			// first - RaiseCallbackEvent
			// second - GetCallbackResult

			if (html.IndexOf ("12|true|true") < 0)
				Assert.Fail ("CallBack#1");

			fr.Controls["__EVENTTARGET"].Value = "";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			fr.Controls ["__CALLBACKTARGET"].Value = "__Page";
			fr.Controls ["__CALLBACKARGUMENT"].Value = "laptop";

			t.Request = fr;
			html = t.Run ();

			// Into result string the last 2 variables shows if events been done
			// first - RaiseCallbackEvent
			// second - GetCallbackResult

			if (html.IndexOf ("10|true|true") < 0)
				Assert.Fail ("CallBack#2");
		}
Exemplo n.º 18
0
		public void IsUserInRole ()
		{
			WebTest t = new WebTest (PageInvoker.CreateOnLoad ((Page p) => {
						Assert.IsTrue (Roles.Enabled, "Enabled");
						Assert.IsTrue (Roles.IsUserInRole ("true", "rolename"), "#1");
						Assert.IsFalse (Roles.IsUserInRole ("false", "rolename"), "#2");

						// NOTE: The next two tests do NOT throw an exception on MS 
						//       .NET (even if the underlying membership-provider may, 
						//       despite being documented differently on MSDN), but 
						//       this convenient behaviour allows ASP.NET pages to run 
						//       when roles are queried before the user is logged on
						Assert.IsFalse (Roles.IsUserInRole (string.Empty, "rolename"), "#3a");
						Assert.IsFalse (Roles.IsUserInRole ("rolename"), "#3b");
					}));
			t.Run ();
			global::System.Diagnostics.Trace.WriteLineIf ((t.Response.StatusCode != global::System.Net.HttpStatusCode.OK), t.Response.Body);
			Assert.AreEqual (global::System.Net.HttpStatusCode.OK, t.Response.StatusCode, "HttpStatusCode");
		}
Exemplo n.º 19
0
		public void StateFormatter_CorrectConverter ()
		{
			// We test only if it doesn't throw exception on postback
			try {
				WebTest.Host.AppDomain.AssemblyResolve += new ResolveEventHandler (ResolveAssemblyHandler);
				WebTest t = new WebTest ("StateFormatter_CorrectConverter.aspx");
				t.Run ();

				var fr = new FormRequest (t.Response, "Form1");
				fr.Controls.Add ("Button1");
				fr.Controls ["Button1"].Value = "Change";
				t.Request = fr;
				t.Run ();

				fr = new FormRequest (t.Response, "Form1");
				fr.Controls.Add ("Button2");
				fr.Controls ["Button2"].Value = "Refresh";
			} finally {
				WebTest.Host.AppDomain.AssemblyResolve -= new ResolveEventHandler (ResolveAssemblyHandler);
			}
		}
		public void FormView_PageIndex2 ()
		{
			PageDelegates delegates = new PageDelegates ();
			delegates.Load = FormView_PageIndex2_load;
			delegates.LoadComplete = FormView_PageIndex2_loadComplete;
			PageInvoker invoker = new PageInvoker (delegates);
			WebTest test = new WebTest (invoker);
			test.Run ();
		}
		public void FormView_RequiresDataBinding () {
			PageDelegates delegates = new PageDelegates ();
			delegates.LoadComplete = FormView_RequiresDataBinding_LoadComplete;
			PageInvoker invoker = new PageInvoker (delegates);
			WebTest t = new WebTest (invoker);
			t.Run ();
		}
		public void FormView_DeleteAndEmptyTemplatePostback ()
		{
			WebTest t = new WebTest ("FormViewInsertEditDelete.aspx");
			string pageHTML = t.Run ();
			
			Assert.AreEqual (true, pageHTML.Contains ("1001"), "BeforeDelete1");
			Assert.AreEqual (true, pageHTML.Contains ("Mahesh"), "BeforeDelete2");
			Assert.AreEqual (true, pageHTML.Contains ("Chand"), "BeforeDelete3");
			Assert.AreEqual (true, pageHTML.Contains ("Page$3"), "BeforeDelete4");	
			//Delete First Item
			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "FormView1$DeleteButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			pageHTML = t.Run ();			
			Assert.AreEqual (true, pageHTML.Contains ("1002"), "AfterFirstDelete1");
			Assert.AreEqual (true, pageHTML.Contains ("Talmadge"), "AfterFirstDelete2");
			Assert.AreEqual (true, pageHTML.Contains ("Melanie"), "AfterFirstDelete3");
			Assert.AreEqual (true, pageHTML.Contains ("Page$2"), "AfterFirstDelete4");
			Assert.AreEqual (false, pageHTML.Contains ("Page$3"), "AfterFirstDelete5");

			//Delete second item

			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "FormView1$DeleteButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			pageHTML = t.Run ();
			Assert.AreEqual (true, pageHTML.Contains ("1003"), "AfterSecondDelete1");
			Assert.AreEqual (true, pageHTML.Contains ("Bansal"), "AfterSecondDelete2");
			Assert.AreEqual (true, pageHTML.Contains ("Vinay"), "AfterSecondDelete3");
			Assert.AreEqual (false, pageHTML.Contains ("Page$2"), "AfterSecondDelete4");	

			//Delete last item and checking that the EmptyDataTemplate appears.

			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "FormView1$DeleteButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			pageHTML = t.Run ();			
			Assert.AreEqual (true, pageHTML.Contains ("FormView1_Label1"), "EmptyTemplateTest1"); 
			Assert.AreEqual (true, pageHTML.Contains ("The Database is empty"), "EmptyTemplateTest2");
		}
		public void FormView_InsertPostback ()
		{
			WebTest t = new WebTest ("FormViewInsertEditDelete.aspx");
			string pageHTML = t.Run ();
			Assert.AreEqual (true, pageHTML.Contains ("1001"), "BeforeInsert1");
			Assert.AreEqual (true, pageHTML.Contains ("Mahesh"), "BeforeInsert2");
			Assert.AreEqual (true, pageHTML.Contains ("Chand"), "BeforeInsert3");
			Assert.AreEqual (false, pageHTML.Contains ("Page$4"), "BeforeInsert4");
			FormRequest fr = new FormRequest (t.Response, "form1"); 
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");			
			fr.Controls["__EVENTTARGET"].Value = "FormView1$NewButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";						
			t.Request = fr;
			pageHTML = t.Run ();
			string newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
#if NET_4_0
			string origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    Insert ID:\n                    <input name=\"FormView1$IDInsert\" type=\"text\" id=\"FormView1_IDInsert\" /><br />\n                    Insert First Name:\n                    <input name=\"FormView1$FNameInsert\" type=\"text\" id=\"FormView1_FNameInsert\" />\n                    <br />\n                    Insert Last Name:&nbsp;\n                    <input name=\"FormView1$LNameInsert\" type=\"text\" id=\"FormView1_LNameInsert\" />\n                    <a id=\"FormView1_InsertButton\" href=\"javascript:__doPostBack(&#39;FormView1$InsertButton&#39;,&#39;&#39;)\">Insert</a>\n                    <a id=\"FormView1_CancelInsertButton\" href=\"javascript:__doPostBack(&#39;FormView1$CancelInsertButton&#39;,&#39;&#39;)\">Cancel</a>\n                </td>\r\n\t</tr>\r\n</table>";
#else
			string origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    Insert ID:\n                    <input name=\"FormView1$IDInsert\" type=\"text\" id=\"FormView1_IDInsert\" /><br />\n                    Insert First Name:\n                    <input name=\"FormView1$FNameInsert\" type=\"text\" id=\"FormView1_FNameInsert\" />\n                    <br />\n                    Insert Last Name:&nbsp;\n                    <input name=\"FormView1$LNameInsert\" type=\"text\" id=\"FormView1_LNameInsert\" />\n                    <a id=\"FormView1_InsertButton\" href=\"javascript:__doPostBack('FormView1$InsertButton','')\">Insert</a>\n                    <a id=\"FormView1_CancelInsertButton\" href=\"javascript:__doPostBack('FormView1$CancelInsertButton','')\">Cancel</a>\n                </td>\r\n\t</tr>\r\n</table>";
#endif
			HtmlDiff.AssertAreEqual (origHtml, newHtml, "InsertPostback");

			//Insert new record

			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls.Add ("FormView1$IDInsert");
			fr.Controls.Add ("FormView1$FNameInsert");
			fr.Controls.Add ("FormView1$LNameInsert");
			fr.Controls["FormView1$IDInsert"].Value = "33";
			fr.Controls["FormView1$FNameInsert"].Value = "InsertFirstName";
			fr.Controls["FormView1$LNameInsert"].Value ="InsertLastName";
			fr.Controls["__EVENTTARGET"].Value = "FormView1$InsertButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			pageHTML = t.Run ();			
			Assert.AreEqual (true, pageHTML.Contains ("1001"), "AfterInsert1");
			Assert.AreEqual (true, pageHTML.Contains ("Mahesh"), "AfterInsert2");
			Assert.AreEqual (true, pageHTML.Contains ("Chand"), "AfterInsert3");
			Assert.AreEqual (true, pageHTML.Contains ("Page$4"), "AfterInsert4");

			//Checking that the inserted record appears on page 4.

			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");			
			fr.Controls["__EVENTTARGET"].Value = "FormView1";
			fr.Controls["__EVENTARGUMENT"].Value = "Page$4";
			t.Request = fr;
			pageHTML = t.Run ();
			Assert.AreEqual (true, pageHTML.Contains ("33"), "AfterInsert1");
			Assert.AreEqual (true, pageHTML.Contains ("InsertLastName"), "AfterInsert2");
			Assert.AreEqual (true, pageHTML.Contains ("InsertFirstName"), "AfterInsert3");
			
		}		
		public void FormView_FireEvent_5 ()
		{
			WebTest t = new WebTest ("FormViewInsertEditDelete.aspx");
			t.Invoker = PageInvoker.CreateOnInit (FireEvent_5_Init);
			t.Run ();

			//Delete Item
			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "FormView1";
			fr.Controls["__EVENTARGUMENT"].Value = "Page$2";
			t.Request = fr;
			t.Run ();

			ArrayList eventlist = t.UserData as ArrayList;
			if (eventlist == null)
				Assert.Fail ("User data does not been created fail");

			Assert.AreEqual ("PageIndexChanging", eventlist[0], "#1");
			Assert.AreEqual ("PageIndexChanged", eventlist[1], "#2");
		}
		public void FormView_FireEvent_3 ()
		{
			WebTest t = new WebTest ("FormViewInsertEditDelete.aspx");
			t.Invoker = PageInvoker.CreateOnInit (FireEvent_3_Init);
			t.Run ();
			
			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "FormView1$NewButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			t.Run ();
			
			//Insert new record

			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls.Add ("FormView1$IDInsert");
			fr.Controls.Add ("FormView1$FNameInsert");
			fr.Controls.Add ("FormView1$LNameInsert");
			fr.Controls["FormView1$IDInsert"].Value = "33";
			fr.Controls["FormView1$FNameInsert"].Value = "InsertFirstName";
			fr.Controls["FormView1$LNameInsert"].Value = "InsertLastName";
			fr.Controls["__EVENTTARGET"].Value = "FormView1$InsertButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			t.Run ();

			ArrayList eventlist = t.UserData as ArrayList;
			if (eventlist == null)
				Assert.Fail ("User data does not been created fail");

			Assert.AreEqual ("ItemInserting", eventlist[0], "#1");
			Assert.AreEqual ("ItemInserted", eventlist[1], "#2");
		}
		public void FormView_FireEvent_2 ()
		{
			WebTest t = new WebTest ("FormViewInsertEditDelete.aspx");
			t.Invoker = PageInvoker.CreateOnInit (FireEvent_2_Init);
			t.Run ();

			// Checking for itemcreated event fired.
			ArrayList eventlist = t.UserData as ArrayList;
			if (eventlist == null)
				Assert.Fail ("User data does not been created fail");

			Assert.AreEqual ("ItemCreated", eventlist[0], "#1");
		}
		public void FormView_FireEvent_1 ()
		{
			WebTest t = new WebTest ("FormViewInsertEditDelete.aspx");
			t.Invoker = PageInvoker.CreateOnInit (EditPostbackFireEvent_Init);
			string html = t.Run ();
			//Edit button postback (change to edit mode - buttons "Update" and "Cancel" should appear.

			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "FormView1$EditButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			html = t.Run ();

			ArrayList eventlist = t.UserData as ArrayList;
			if (eventlist == null)
				Assert.Fail ("User data does not been created fail");

			Assert.AreEqual ("ItemCommand", eventlist[0], "#1");
			Assert.AreEqual ("ModeChanging", eventlist[1], "#2");
			Assert.AreEqual ("ModeChanged", eventlist[2], "#3");
			t.UserData = null;
			
			//Update record postback                

			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls.Add ("FormView1$FNameEdit");
			fr.Controls.Add ("FormView1$LNameEdit");
			fr.Controls["__EVENTTARGET"].Value = "FormView1$UpdateButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			fr.Controls["FormView1$FNameEdit"].Value = "Merav";
			fr.Controls["FormView1$LNameEdit"].Value = "Test";
			t.Request = fr;
			html = t.Run ();

			eventlist = t.UserData as ArrayList;
			if (eventlist == null)
				Assert.Fail ("User data does not been created fail");

			Assert.AreEqual ("ItemCommand", eventlist[0], "#1");
			Assert.AreEqual ("ItemUpdating", eventlist[1], "#2");
			Assert.AreEqual ("ItemUpdated", eventlist[2], "#3");
			Assert.AreEqual ("ModeChanging", eventlist[3], "#4");
			Assert.AreEqual ("ModeChanged", eventlist[4], "#5");
		}
		public void FormView_PagerSettings_Visibility ()
		{
#if NET_4_0
			string origHtml = "<table cellspacing=\"2\" cellpadding=\"3\" rules=\"all\" id=\"FormView1\" style=\"background-color:#DEBA84;border-color:#DEBA84;border-width:1px;border-style:None;\">\r\n\t<tr style=\"color:#8C4510;background-color:#FFF7E7;\">\r\n\t\t<td colspan=\"2\">\n          <span id=\"FormView1_Label1\">1</span>\n\t</td>\r\n\t</tr>\r\n</table>";
#else
			string origHtml = "<table cellspacing=\"2\" cellpadding=\"3\" rules=\"all\" border=\"1\" id=\"FormView1\" style=\"background-color:#DEBA84;border-color:#DEBA84;border-width:1px;border-style:None;\">\r\n\t<tr style=\"color:#8C4510;background-color:#FFF7E7;\">\r\n\t\t<td colspan=\"2\">\n          <span id=\"FormView1_Label1\">1</span>\n\t</td>\r\n\t</tr>\r\n</table>";
#endif
			WebTest t = new WebTest ("FormViewPagerVisibility.aspx");
			string pageHtml = t.Run ();
			string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);

			HtmlDiff.AssertAreEqual (origHtml, renderedHtml, "#A1");
		}
		public void FormView_EditPostback ()
		{
			WebTest t = new WebTest ("FormViewInsertEditDelete.aspx");
			string pageHTML = t.Run ();
			string newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
#if NET_4_0
			string origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    <span id=\"FormView1_ID\">1001</span>&nbsp;\n                    <span id=\"FormView1_LName\">Chand</span>\n                    <span id=\"FormView1_FName\">Mahesh</span>&nbsp;\n                    <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack(&#39;FormView1$EditButton&#39;,&#39;&#39;)\">Edit</a>\n                    <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack(&#39;FormView1$NewButton&#39;,&#39;&#39;)\">New</a>\n                    <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack(&#39;FormView1$DeleteButton&#39;,&#39;&#39;)\">Delete</a>\n                </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack(&#39;FormView1&#39;,&#39;Page$2&#39;)\">2</a></td><td><a href=\"javascript:__doPostBack(&#39;FormView1&#39;,&#39;Page$3&#39;)\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#else
			string origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    <span id=\"FormView1_ID\">1001</span>&nbsp;\n                    <span id=\"FormView1_LName\">Chand</span>\n                    <span id=\"FormView1_FName\">Mahesh</span>&nbsp;\n                    <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack('FormView1$EditButton','')\">Edit</a>\n                    <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack('FormView1$NewButton','')\">New</a>\n                    <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack('FormView1$DeleteButton','')\">Delete</a>\n                </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#endif
			HtmlDiff.AssertAreEqual (origHtml, newHtml, "BeforeEditPostback");

			//Edit button postback (change to edit mode - buttons "Update" and "Cancel" should appear.
			
			FormRequest fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "FormView1$EditButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			pageHTML = t.Run ();
			newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
#if NET_4_0
			origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    Enter First Name:<input name=\"FormView1$FNameEdit\" type=\"text\" value=\"Mahesh\" id=\"FormView1_FNameEdit\" /><br />\n                    Enter Last Name:<input name=\"FormView1$LNameEdit\" type=\"text\" value=\"Chand\" id=\"FormView1_LNameEdit\" /><br />\n                    <a id=\"FormView1_UpdateButton\" href=\"javascript:__doPostBack(&#39;FormView1$UpdateButton&#39;,&#39;&#39;)\">Update</a>\n                    <a id=\"FormView1_CancelUpdateButton\" href=\"javascript:__doPostBack(&#39;FormView1$CancelUpdateButton&#39;,&#39;&#39;)\">Cancel</a>\n                </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack(&#39;FormView1&#39;,&#39;Page$2&#39;)\">2</a></td><td><a href=\"javascript:__doPostBack(&#39;FormView1&#39;,&#39;Page$3&#39;)\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#else
			origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    Enter First Name:<input name=\"FormView1$FNameEdit\" type=\"text\" value=\"Mahesh\" id=\"FormView1_FNameEdit\" /><br />\n                    Enter Last Name:<input name=\"FormView1$LNameEdit\" type=\"text\" value=\"Chand\" id=\"FormView1_LNameEdit\" /><br />\n                    <a id=\"FormView1_UpdateButton\" href=\"javascript:__doPostBack('FormView1$UpdateButton','')\">Update</a>\n                    <a id=\"FormView1_CancelUpdateButton\" href=\"javascript:__doPostBack('FormView1$CancelUpdateButton','')\">Cancel</a>\n                </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#endif
			HtmlDiff.AssertAreEqual (origHtml, newHtml, "AfterEditPostback");

			//Update record postback                
			
			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls.Add ("FormView1$FNameEdit");
			fr.Controls.Add ("FormView1$LNameEdit");
			fr.Controls["__EVENTTARGET"].Value = "FormView1$UpdateButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";			
			fr.Controls["FormView1$FNameEdit"].Value = "Merav";
			fr.Controls["FormView1$LNameEdit"].Value = "Test";			
			t.Request = fr;
			pageHTML = t.Run ();
			newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
#if NET_4_0
			origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    <span id=\"FormView1_ID\">1001</span>&nbsp;\n                    <span id=\"FormView1_LName\">Test</span>\n                    <span id=\"FormView1_FName\">Merav</span>&nbsp;\n                    <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack(&#39;FormView1$EditButton&#39;,&#39;&#39;)\">Edit</a>\n                    <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack(&#39;FormView1$NewButton&#39;,&#39;&#39;)\">New</a>\n                    <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack(&#39;FormView1$DeleteButton&#39;,&#39;&#39;)\">Delete</a>\n                </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack(&#39;FormView1&#39;,&#39;Page$2&#39;)\">2</a></td><td><a href=\"javascript:__doPostBack(&#39;FormView1&#39;,&#39;Page$3&#39;)\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#else
			origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    <span id=\"FormView1_ID\">1001</span>&nbsp;\n                    <span id=\"FormView1_LName\">Test</span>\n                    <span id=\"FormView1_FName\">Merav</span>&nbsp;\n                    <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack('FormView1$EditButton','')\">Edit</a>\n                    <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack('FormView1$NewButton','')\">New</a>\n                    <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack('FormView1$DeleteButton','')\">Delete</a>\n                </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#endif
			HtmlDiff.AssertAreEqual (origHtml, newHtml, "AfterUpdatePostback"); 
  
			//Postback to return to Edit mode
			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls["__EVENTTARGET"].Value = "FormView1$EditButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";			
			t.Request = fr;
			pageHTML = t.Run ();
			newHtml = pageHTML.Substring (pageHTML.IndexOf ("start") + 5, pageHTML.IndexOf ("end") - pageHTML.IndexOf ("start") - 5);
			Assert.AreEqual (true, pageHTML.Contains ("Merav"), "EditModePostback1");
			Assert.AreEqual (true, pageHTML.Contains ("CancelUpdateButton"), "EditModePostback2"); 

			// Cancel edited record postback
			fr = new FormRequest (t.Response, "form1");
			fr.Controls.Add ("__EVENTTARGET");
			fr.Controls.Add ("__EVENTARGUMENT");
			fr.Controls.Add ("FormView1$FNameEdit");
			fr.Controls.Add ("FormView1$LNameEdit");
			fr.Controls["FormView1$FNameEdit"].Value = "EditFirstName";
			fr.Controls["FormView1$LNameEdit"].Value = "EditLastName";
			fr.Controls["__EVENTTARGET"].Value = "FormView1$CancelUpdateButton";
			fr.Controls["__EVENTARGUMENT"].Value = "";
			t.Request = fr;
			pageHTML = t.Run ();
			newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
#if NET_4_0
			origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    <span id=\"FormView1_ID\">1001</span>&nbsp;\n                    <span id=\"FormView1_LName\">Test</span>\n                    <span id=\"FormView1_FName\">Merav</span>&nbsp;\n                    <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack(&#39;FormView1$EditButton&#39;,&#39;&#39;)\">Edit</a>\n                    <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack(&#39;FormView1$NewButton&#39;,&#39;&#39;)\">New</a>\n                    <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack(&#39;FormView1$DeleteButton&#39;,&#39;&#39;)\">Delete</a>\n                </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack(&#39;FormView1&#39;,&#39;Page$2&#39;)\">2</a></td><td><a href=\"javascript:__doPostBack(&#39;FormView1&#39;,&#39;Page$3&#39;)\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#else
			origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n                    <span id=\"FormView1_ID\">1001</span>&nbsp;\n                    <span id=\"FormView1_LName\">Test</span>\n                    <span id=\"FormView1_FName\">Merav</span>&nbsp;\n                    <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack('FormView1$EditButton','')\">Edit</a>\n                    <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack('FormView1$NewButton','')\">New</a>\n                    <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack('FormView1$DeleteButton','')\">Delete</a>\n                </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#endif
			HtmlDiff.AssertAreEqual (origHtml, newHtml, "CancelEditedRecordPostback");   
		}
		public void FormView_Render ()
		{
			string RenderedPageHtml = new WebTest ("FormViewTest1_3.aspx").Run ();
			string newHtmlValue = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
#if NET_4_0
			string origHtmlValue = "<table cellspacing=\"0\" cellpadding=\"2\" id=\"FormView3\" style=\"color:Black;background-color:LightGoldenrodYellow;border-color:Tan;border-width:1px;border-style:solid;border-collapse:collapse;\">\r\n\t<tr align=\"center\" valign=\"top\" style=\"color:#C00000;background-color:Tan;font-weight:bold;\">\r\n\t\t<td colspan=\"2\">\n                <span id=\"FormView3_Label5\">Header Template Test</span>\n            </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\">\n                <span id=\"FormView3_Label4\">1</span>\n            </td>\r\n\t</tr><tr align=\"right\" style=\"color:#FFC0FF;background-color:Tan;\">\r\n\t\t<td colspan=\"2\">\n                <span id=\"FormView3_Label6\">FormView Footer</span>\n            </td>\r\n\t</tr><tr align=\"center\" style=\"color:DarkSlateBlue;background-color:PaleGoldenrod;\">\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack(&#39;FormView3&#39;,&#39;Page$2&#39;)\" style=\"color:DarkSlateBlue;\">2</a></td><td><a href=\"javascript:__doPostBack(&#39;FormView3&#39;,&#39;Page$3&#39;)\" style=\"color:DarkSlateBlue;\">3</a></td><td><a href=\"javascript:__doPostBack(&#39;FormView3&#39;,&#39;Page$4&#39;)\" style=\"color:DarkSlateBlue;\">4</a></td><td><a href=\"javascript:__doPostBack(&#39;FormView3&#39;,&#39;Page$5&#39;)\" style=\"color:DarkSlateBlue;\">5</a></td><td><a href=\"javascript:__doPostBack(&#39;FormView3&#39;,&#39;Page$6&#39;)\" style=\"color:DarkSlateBlue;\">6</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
#else
			string origHtmlValue = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" id=\"FormView3\" style=\"color:Black;background-color:LightGoldenrodYellow;border-color:Tan;border-width:1px;border-style:solid;border-collapse:collapse;\">\r\n\t<tr align=\"center\" valign=\"top\" style=\"color:#C00000;background-color:Tan;font-weight:bold;\">\r\n\t\t<td colspan=\"2\">\n                <span id=\"FormView3_Label5\">Header Template Test</span>\n            </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\">\n                <span id=\"FormView3_Label4\">1</span>\n            </td>\r\n\t</tr><tr align=\"right\" style=\"color:#FFC0FF;background-color:Tan;\">\r\n\t\t<td colspan=\"2\">\n                <span id=\"FormView3_Label6\">FormView Footer</span>\n            </td>\r\n\t</tr><tr align=\"center\" style=\"color:DarkSlateBlue;background-color:PaleGoldenrod;\">\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView3','Page$2')\" style=\"color:DarkSlateBlue;\">2</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$3')\" style=\"color:DarkSlateBlue;\">3</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$4')\" style=\"color:DarkSlateBlue;\">4</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$5')\" style=\"color:DarkSlateBlue;\">5</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$6')\" style=\"color:DarkSlateBlue;\">6</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";        
#endif
			HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderingDefaultPaging");
		}
Exemplo n.º 31
0
 public void SendHeaders(WebTest t)
 {
     HttpContext.Current.Response.AppendHeader(USER_HEADER, Serialize(t.UserData));
 }
Exemplo n.º 32
0
        public WebTest Run(WebTest t)
        {
            NameValueCollection headers = new NameValueCollection();

            headers.Add(INVOKER_HEADER, Serialize(t.Invoker));
            headers.Add(USER_HEADER, Serialize(t.UserData));
            WebRequest wr = t.Request.CreateWebRequest(
                new Uri("http://localhost:59598/NunitWebTest/"),
                headers);


            WebResponse response = null;

            try {
                response = wr.GetResponse();
                HttpStatusCode status = ((HttpWebResponse)response).StatusCode;
                if (status != HttpStatusCode.OK && status != HttpStatusCode.Found)
                {
                    throw new WebException(((HttpWebResponse)response).StatusCode.ToString());
                }

                t.Response = t.Request.ExtractResponse(response);
                string etype = response.Headers [EXCEPTION_HEADER];

                if (!String.IsNullOrEmpty(etype))
                {
                    Exception e;
                    string    data  = t.Response.Body;
                    int       start = data.IndexOf(EXCEPTION_HEADER);
                    if (start >= 0)
                    {
                        start += EXCEPTION_HEADER.Length;
                        int end    = data.IndexOf(EXCEPTION_HEADER, start);
                        int length = int.Parse(data.Substring(start, end - start));

                        string serialized = data.Substring(end + EXCEPTION_HEADER.Length, length);
                        e = (Exception)DeserializeBinary(serialized);
                    }
                    else
                    {
                        e = (Exception)Activator.CreateInstance(Type.GetType(etype));
                    }

                    if (e != null)
                    {
                        RethrowException(e);
                    }
                }


                t.UserData = Deserialize(response.Headers [USER_HEADER]);
            }
            finally {
                if (response != null)
                {
                    response.Close();
                }
            }

            return(t);
        }
Exemplo n.º 33
0
 internal void SendHeaders(WebTest webTest)
 {
     //nothing to do in this host
 }